Skip to content
Permalink
Browse files

[layouts] Final fixes for data defined widgets showing outdated

data defined definitions when clicking between layout items
of the same type

Fixes #18694
  • Loading branch information
nyalldawson committed Oct 26, 2018
1 parent 5e3fdb9 commit bbdbfa17a966d852f3bf16b2c083fdb532947f5d
@@ -55,6 +55,7 @@ Returns the current layout context coverage layer (if set).
Returns the atlas for the layout, if available
%End


};

class QgsLayoutItemBaseWidget: QgsPanelWidget
@@ -119,6 +119,11 @@ QgsLayoutAtlas *QgsLayoutConfigObject::layoutAtlas() const
return printLayout->atlas();
}

void QgsLayoutConfigObject::setObject( QgsLayoutObject *object )
{
mLayoutObject = object;
}

QgsVectorLayer *QgsLayoutConfigObject::coverageLayer() const
{
if ( !mLayoutObject )
@@ -321,6 +326,8 @@ void QgsLayoutItemPropertiesWidget::setItem( QgsLayoutItem *item )
connect( mItem, &QgsLayoutObject::changed, this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
}

mConfigObject->setObject( mItem );

setValuesForGuiElements();
}

@@ -86,6 +86,15 @@ class GUI_EXPORT QgsLayoutConfigObject: public QObject
//! Returns the atlas for the layout, if available
QgsLayoutAtlas *layoutAtlas() const;

/**
* Links a new layout \a object to this QgsLayoutConfigObject. The object must be the same type as the existing
* object.
*
* \note Not available in Python bindings
* \since QGIS 3.4
*/
void setObject( QgsLayoutObject *object ) SIP_SKIP;

private slots:
//! Must be called when a data defined button changes
void updateDataDefinedProperty();

0 comments on commit bbdbfa1

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