Skip to content
Permalink
Browse files

[layouts] Fix some data defined buttons don't update when

clicking between objects of same type

Refs #18694
  • Loading branch information
nyalldawson committed Oct 26, 2018
1 parent e991d98 commit 5e3fdb96b8fa2175b578f7d3ff07b8e00ddd91de
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/gui/layout/qgslayoutitemwidget.cpp
@@ -81,7 +81,7 @@ void QgsLayoutConfigObject::initializeDataDefinedButton( QgsPropertyOverrideButt
{
button->blockSignals( true );
button->init( key, mLayoutObject->dataDefinedProperties(), QgsLayoutObject::propertyDefinitions(), coverageLayer() );
connect( button, &QgsPropertyOverrideButton::changed, this, &QgsLayoutConfigObject::updateDataDefinedProperty );
connect( button, &QgsPropertyOverrideButton::changed, this, &QgsLayoutConfigObject::updateDataDefinedProperty, Qt::UniqueConnection );
button->registerExpressionContextGenerator( mLayoutObject );
button->blockSignals( false );
}
@@ -96,6 +96,10 @@ void QgsLayoutConfigObject::updateDataDefinedButton( QgsPropertyOverrideButton *

QgsLayoutObject::DataDefinedProperty key = static_cast< QgsLayoutObject::DataDefinedProperty >( button->propertyKey() );
whileBlocking( button )->setToProperty( mLayoutObject->dataDefinedProperties().property( key ) );

// In case the button was initialized to a different config object, we need to reconnect to it here (see https://issues.qgis.org/issues/18694 )
connect( button, &QgsPropertyOverrideButton::changed, this, &QgsLayoutConfigObject::updateDataDefinedProperty, Qt::UniqueConnection );
button->registerExpressionContextGenerator( mLayoutObject );
}

QgsLayoutAtlas *QgsLayoutConfigObject::layoutAtlas() const

0 comments on commit 5e3fdb9

Please sign in to comment.
You can’t perform that action at this time.