예제 #1
0
void MultilineOptionView::_createItem() {
	myMultiLineEdit = new QMultiLineEdit(myTab->widget());
	myMultiLineEdit->setWordWrap(QMultiLineEdit::WidgetWidth);
	myMultiLineEdit->setWrapPolicy(QMultiLineEdit::AtWhiteSpace);
	connect(myMultiLineEdit, SIGNAL(textChanged()), this, SLOT(onValueEdited()));
	myTab->addItem(myMultiLineEdit, myRow, myFromColumn, myToColumn);
	reset();
}
예제 #2
0
bool GraphViewer::eventFilter(QObject * object, QEvent * event)
{
    if (&_scene == object)
    {
        if (event->type() == QEvent::GraphicsSceneMousePress)
        {
            onSceneMousePress(static_cast<QGraphicsSceneMouseEvent*>(event));
        }
        else if (event->type() == QEvent::GraphicsSceneMouseMove && _isDrawingEdge)
        {
            onSceneMouseMove(static_cast<QGraphicsSceneMouseEvent*>(event));
        }
        else if (event->type() == QEvent::GraphicsSceneMouseRelease && _isDrawingEdge)
        {
            onSceneMouseRelease(static_cast<QGraphicsSceneMouseEvent*>(event));
        }
        else if (event->type() == QEvent::GraphicsSceneMouseDoubleClick)
        {
            onSceneMouseDoubleClick(static_cast<QGraphicsSceneMouseEvent*>(event));
        }
    }
    else if (object == &_valueEditor && _valueEditor.isVisible())
    {
        if (event->type() == QEvent::KeyRelease)
        {
            QKeyEvent * e = static_cast<QKeyEvent*>(event);
            if (e->key() == Qt::Key_Escape)
            {
                _valueEditor.hide();
            }
            else if (e->key() == Qt::Key_Enter)
            {
                onValueEdited();
            }
        }
    }
    return QWidget::eventFilter(object, event);
}
예제 #3
0
void ZLTextOptionEntry::onValueEdited(const char *value) {
	onValueEdited((value != 0) ? std::string(value) : std::string());
}
PluginSettingsSpinbox::PluginSettingsSpinbox(QWidget *parent) :
    QSpinBox(parent)
{
    connect(this, SIGNAL(editingFinished()), this, SLOT(onValueEdited()));
}