31 connect( mKeyColumn, SIGNAL( currentIndexChanged(
int ) ),
this, SIGNAL(
changed() ) );
32 connect( mValueColumn, SIGNAL( currentIndexChanged(
int ) ),
this, SIGNAL(
changed() ) );
33 connect( mAllowMulti, SIGNAL( toggled(
bool ) ),
this, SIGNAL(
changed() ) );
34 connect( mAllowNull, SIGNAL( toggled(
bool ) ),
this, SIGNAL(
changed() ) );
35 connect( mOrderByValue, SIGNAL( toggled(
bool ) ),
this, SIGNAL(
changed() ) );
36 connect( mFilterExpression, SIGNAL( textChanged() ),
this, SIGNAL(
changed() ) );
37 connect( mUseCompleter, SIGNAL( toggled(
bool ) ),
this, SIGNAL(
changed() ) );
44 cfg.insert(
"Layer", mLayerName->currentLayer() ? mLayerName->currentLayer()->id() :
QString() );
45 cfg.insert(
"Key", mKeyColumn->currentField() );
46 cfg.insert(
"Value", mValueColumn->currentField() );
47 cfg.insert(
"AllowMulti", mAllowMulti->isChecked() );
48 cfg.insert(
"AllowNull", mAllowNull->isChecked() );
49 cfg.insert(
"OrderByValue", mOrderByValue->isChecked() );
50 cfg.insert(
"FilterExpression", mFilterExpression->toPlainText() );
51 cfg.insert(
"UseCompleter", mUseCompleter->isChecked() );
59 mLayerName->setLayer( lyr );
60 mKeyColumn->setField( config.value(
"Key" ).toString() );
61 mValueColumn->setField( config.value(
"Value" ).toString() );
62 mAllowMulti->setChecked( config.value(
"AllowMulti" ).toBool() );
63 mAllowNull->setChecked( config.value(
"AllowNull" ).toBool() );
64 mOrderByValue->setChecked( config.value(
"OrderByValue" ).toBool() );
65 mFilterExpression->setPlainText( config.value(
"FilterExpression" ).toString() );
66 mUseCompleter->setChecked( config.value(
"UseCompleter" ).toBool() );
83 if ( dlg.exec() == QDialog::Accepted )
85 mFilterExpression->setText( dlg.expressionBuilder()->expressionText() );
Base class for all map layer types.
QgsEditorWidgetConfig config() override
Create a configuration from the current GUI state.
QgsMapLayer * mapLayer(const QString &theLayerId) const
Retrieve a pointer to a registered layer by layer ID.
QString tr(const char *sourceText, const char *disambiguation, int n)
QVariantMap QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
static QgsExpressionContextScope * projectScope()
Creates a new scope which contains variables and functions relating to the current QGIS project...
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
QgsValueRelationConfigDlg(QgsVectorLayer *vl, int fieldIdx, QWidget *parent=nullptr)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
A generic dialog for building expression strings.
void setConfig(const QgsEditorWidgetConfig &config) override
Update the configuration widget to represent the given configuration.