void PositionParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);

		mPositionEdit = new PositionEdit(parent);
        connect(mPositionEdit, SIGNAL(positionChosen(QPointF)), this, SLOT(positionChosen(QPointF)));

		addEditor(mPositionEdit);

        mPositionUnitComboBox = new QComboBox(parent);

        mPositionUnitComboBox->addItems(QStringList() << tr("pixels") << tr("percents"));

        addEditor(mPositionUnitComboBox);
	}
	void ColorPositionParameterDefinition::buildEditors(Script *script, QWidget *parent)
	{
		ParameterDefinition::buildEditors(script, parent);
		
		mPositionEdit = new PositionEdit(parent);

		addEditor(mPositionEdit);
	
		mColorEdit = new ColorEdit(parent);
		mColorEdit->setChooseByPositionButtonVisible(false);

		addEditor(mColorEdit);
		
        connect(mPositionEdit, SIGNAL(positionChosen(QPointF)), mColorEdit, SLOT(setPosition(QPointF)), Qt::QueuedConnection);
        connect(mColorEdit, SIGNAL(positionChosen(QPointF)), mPositionEdit, SLOT(setPosition(QPointF)), Qt::QueuedConnection);
	}
예제 #3
0
	void ChoosePositionPushButton::mouseReleaseEvent(QMouseEvent *event)
	{
		QPushButton::mouseReleaseEvent(event);

		emit positionChosen(event->globalPos());

		stopMouseCapture();
	}
예제 #4
0
	PointListWidget::PointListWidget(QWidget *parent)
		: QWidget(parent),
		ui(new Ui::PointListWidget)
	{
		ui->setupUi(this);

		setMinimumHeight(250);

		updateClearStatus();
		on_list_itemSelectionChanged();

		delete ui->list->itemDelegate();
		ui->list->setItemDelegate(new PointItemDelegate(this));

        connect(ui->addPositionPushButton, SIGNAL(positionChosen(QPointF)), this, SLOT(positionChosen(QPointF)), Qt::QueuedConnection);
        connect(ui->capturePathPushButton, SIGNAL(positionChosen(QPointF)), this, SLOT(stopCapture()), Qt::QueuedConnection);
		connect(&mCaptureTimer, SIGNAL(timeout()), this, SLOT(capture()));
	}
예제 #5
0
	bool ChoosePositionPushButton::x11EventFilter(XEvent *event)
	{
		if(event->type == ButtonRelease)
		{
			emit positionChosen(QCursor::pos());

			stopMouseCapture();

			return true;
		}

		return false;
	}
예제 #6
0
    bool ChoosePositionPushButton::nativeEventFilter(const QByteArray &eventType, void *message, long *)
    {
        if(eventType == "xcb_generic_event_t")
        {
            auto* event = static_cast<xcb_generic_event_t *>(message);

            switch(event->response_type)
            {
            case XCB_BUTTON_RELEASE:
                emit positionChosen(QCursor::pos());

                stopMouseCapture();

                return false;
            }

            return false;
        }

        return false;
    }
예제 #7
0
	void ColorEdit::on_chooseByPosition_positionChosen(QPoint position)
	{
		setPosition(position);
		
		emit positionChosen(position);
	}
예제 #8
0
    void PositionEdit::on_choose_positionChosen(QPointF position)
	{
		setPosition(position);
		
        emit positionChosen(position);
	}