29 connect( mComboRelation, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( relationChanged(
int ) ) );
33 mComboRelation->addItem( QString(
"%1 (%2)" ).arg( relation.
id(), relation.
referencedLayerId() ), relation.
id() );
43 if ( config.contains(
"AllowNULL" ) )
45 mCbxAllowNull->setChecked( config[
"AllowNULL" ].toBool() );
48 if ( config.contains(
"OrderByValue" ) )
50 mCbxOrderByValue->setChecked( config[
"OrderByValue" ].toBool() );
53 if ( config.contains(
"ShowForm" ) )
55 mCbxShowForm->setChecked( config[
"ShowForm" ].toBool() );
58 if ( config.contains(
"Relation" ) )
60 mComboRelation->setCurrentIndex( mComboRelation->findData( config[
"Relation" ].toString() ) );
63 if ( config.contains(
"MapIdentification" ) )
65 mCbxMapIdentification->setChecked( config[
"MapIdentification"].toBool() );
68 if ( config.contains(
"ReadOnly" ) )
70 mCbxReadOnly->setChecked( config[
"ReadOnly"].toBool() );
74 void QgsRelationReferenceConfigDlg::relationChanged(
int idx )
76 QString relName = mComboRelation->itemData( idx ).toString();
80 mExpressionWidget->setLayer( referencedLayer );
81 if ( referencedLayer )
84 mCbxMapIdentification->setEnabled( referencedLayer->
hasGeometryType() );
91 myConfig.insert(
"AllowNULL", mCbxAllowNull->isChecked() );
92 myConfig.insert(
"OrderByValue", mCbxOrderByValue->isChecked() );
93 myConfig.insert(
"ShowForm", mCbxShowForm->isChecked() );
94 myConfig.insert(
"MapIdentification", mCbxMapIdentification->isEnabled() && mCbxMapIdentification->isChecked() );
95 myConfig.insert(
"ReadOnly", mCbxReadOnly->isChecked() );
96 myConfig.insert(
"Relation", mComboRelation->itemData( mComboRelation->currentIndex() ) );
98 QString relName = mComboRelation->itemData( mComboRelation->currentIndex() ).toString();