mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-10 00:13:55 -04:00
fixes #30564 : Emit signal for value relation widget so other dependent widgets
could be updated
This commit is contained in:
parent
956c6d694e
commit
540df6c0c0
@ -277,6 +277,11 @@ void QgsValueRelationWidgetWrapper::setFeature( const QgsFeature &feature )
|
||||
setFormFeature( feature );
|
||||
whileBlocking( this )->populate();
|
||||
whileBlocking( this )->setValue( feature.attribute( fieldIdx() ) );
|
||||
|
||||
// As we block any signals, possible depending widgets will not being updated
|
||||
// so we force emit signal once and for all
|
||||
emitValueChanged();
|
||||
|
||||
// A bit of logic to set the default value if AllowNull is false and this is a new feature
|
||||
// Note that this needs to be here after the cache has been created/updated by populate()
|
||||
// and signals unblocked (we want this to propagate to the feature itself)
|
||||
|
@ -175,7 +175,12 @@ void TestQgsValueRelationWidgetWrapper::testDrillDown()
|
||||
|
||||
QCOMPARE( w_municipality.mCache.size(), 2 );
|
||||
QCOMPARE( w_municipality.mComboBox->count(), 2 );
|
||||
|
||||
// check that valueChanged signal is correctly triggered
|
||||
QSignalSpy spy( &w_municipality, &QgsEditorWidgetWrapper::valueChanged );
|
||||
|
||||
w_municipality.setFeature( f3 );
|
||||
QCOMPARE( spy.count(), 1 );
|
||||
QCOMPARE( w_municipality.mCache.size(), 1 );
|
||||
|
||||
// Check first is selected
|
||||
|
Loading…
x
Reference in New Issue
Block a user