Skip to content

Commit bbdbfa1

Browse files
committedOct 26, 2018
[layouts] Final fixes for data defined widgets showing outdated
data defined definitions when clicking between layout items of the same type Fixes #18694
1 parent 5e3fdb9 commit bbdbfa1

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
 

‎python/gui/auto_generated/layout/qgslayoutitemwidget.sip.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Returns the current layout context coverage layer (if set).
5555
Returns the atlas for the layout, if available
5656
%End
5757

58+
5859
};
5960

6061
class QgsLayoutItemBaseWidget: QgsPanelWidget

‎src/gui/layout/qgslayoutitemwidget.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ QgsLayoutAtlas *QgsLayoutConfigObject::layoutAtlas() const
119119
return printLayout->atlas();
120120
}
121121

122+
void QgsLayoutConfigObject::setObject( QgsLayoutObject *object )
123+
{
124+
mLayoutObject = object;
125+
}
126+
122127
QgsVectorLayer *QgsLayoutConfigObject::coverageLayer() const
123128
{
124129
if ( !mLayoutObject )
@@ -321,6 +326,8 @@ void QgsLayoutItemPropertiesWidget::setItem( QgsLayoutItem *item )
321326
connect( mItem, &QgsLayoutObject::changed, this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
322327
}
323328

329+
mConfigObject->setObject( mItem );
330+
324331
setValuesForGuiElements();
325332
}
326333

‎src/gui/layout/qgslayoutitemwidget.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ class GUI_EXPORT QgsLayoutConfigObject: public QObject
8686
//! Returns the atlas for the layout, if available
8787
QgsLayoutAtlas *layoutAtlas() const;
8888

89+
/**
90+
* Links a new layout \a object to this QgsLayoutConfigObject. The object must be the same type as the existing
91+
* object.
92+
*
93+
* \note Not available in Python bindings
94+
* \since QGIS 3.4
95+
*/
96+
void setObject( QgsLayoutObject *object ) SIP_SKIP;
97+
8998
private slots:
9099
//! Must be called when a data defined button changes
91100
void updateDataDefinedProperty();

0 commit comments

Comments
 (0)
Please sign in to comment.