35 cfg.
insert(
"Layer", mLayerName->currentLayer() ? mLayerName->currentLayer()->id() :
QString() );
36 cfg.
insert(
"Key", mKeyColumn->currentField() );
37 cfg.
insert(
"Value", mValueColumn->currentField() );
38 cfg.
insert(
"AllowMulti", mAllowMulti->isChecked() );
39 cfg.
insert(
"AllowNull", mAllowNull->isChecked() );
40 cfg.
insert(
"OrderByValue", mOrderByValue->isChecked() );
41 cfg.
insert(
"FilterExpression", mFilterExpression->toPlainText() );
42 cfg.
insert(
"UseCompleter", mUseCompleter->isChecked() );
50 mLayerName->setLayer( lyr );
51 mKeyColumn->setField( config.
value(
"Key" ).toString() );
52 mValueColumn->setField( config.
value(
"Value" ).toString() );
53 mAllowMulti->setChecked( config.
value(
"AllowMulti" ).toBool() );
54 mAllowNull->setChecked( config.
value(
"AllowNull" ).toBool() );
55 mOrderByValue->setChecked( config.
value(
"OrderByValue" ).toBool() );
56 mFilterExpression->setPlainText( config.
value(
"FilterExpression" ).toString() );
57 mUseCompleter->setChecked( config.
value(
"UseCompleter" ).toBool() );
69 if ( dlg.exec() == QDialog::Accepted )
71 mFilterExpression->setText( dlg.expressionBuilder()->expressionText() );
Base class for all map layer types.
QgsEditorWidgetConfig config() override
Create a configuration from the current GUI state.
QString tr(const char *sourceText, const char *disambiguation, int n)
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
QgsValueRelationConfigDlg(QgsVectorLayer *vl, int fieldIdx, QWidget *parent=0)
QgsMapLayer * mapLayer(QString theLayerId)
Retrieve a pointer to a loaded layer by id.
iterator insert(const Key &key, const T &value)
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.
const T value(const Key &key) const
void setConfig(const QgsEditorWidgetConfig &config) override
Update the configuration widget to represent the given configuration.