File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ void QgsEditorWidgetWrapper::setEnabled( bool enabled )
68
68
69
69
void QgsEditorWidgetWrapper::setFeature ( const QgsFeature &feature )
70
70
{
71
- mFormFeature = feature;
71
+ setFormFeature ( feature ) ;
72
72
setValue ( feature.attribute ( mFieldIdx ) );
73
73
}
74
74
Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ void QgsValueRelationWidgetWrapper::widgetValueChanged( const QString &attribute
212
212
// Do nothing if the value has not changed
213
213
if ( attributeChanged )
214
214
{
215
+ QVariant oldValue ( value ( ) );
215
216
setFormFeatureAttribute ( attribute, newValue );
216
217
// Update combos if the value used in the filter expression has changed
217
218
if ( QgsValueRelationFieldFormatter::expressionRequiresFormScope ( mExpression )
@@ -220,6 +221,15 @@ void QgsValueRelationWidgetWrapper::widgetValueChanged( const QString &attribute
220
221
populate ();
221
222
// Restore value
222
223
setValue ( value ( ) );
224
+ // If the value has changed as a result of another widget's value change,
225
+ // we need to emit the signal to make sure other dependent widgets are
226
+ // updated.
227
+ if ( oldValue != value () && fieldIdx () < formFeature ().fields ().count () )
228
+ {
229
+ QString attributeName ( formFeature ().fields ().names ().at ( fieldIdx () ) );
230
+ setFormFeatureAttribute ( attributeName, value ( ) );
231
+ emitValueChanged ( );
232
+ }
223
233
}
224
234
}
225
235
}
You can’t perform that action at this time.
0 commit comments