Skip to content
Permalink
Browse files

[layouts] Fix data defined buttons do not update when clicking

between items of same type

Fixes #18637, #18639

(cherry-picked from 3c08e2)
  • Loading branch information
nyalldawson committed Apr 6, 2018
1 parent 7f24b6f commit 0b627b303d9e2cb5aad10bf5a241f6cbeb4f11e6
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/gui/layout/qgslayoutitemwidget.cpp
@@ -147,13 +147,24 @@ QgsLayoutObject *QgsLayoutItemBaseWidget::layoutObject()

bool QgsLayoutItemBaseWidget::setItem( QgsLayoutItem *item )
{
QgsLayoutObject *oldObject = mObject;
QgsLayoutConfigObject *oldConfigObject = mConfigObject;
// have to set new mObject/mConfigObject here, because setNewItem methods require access to them
mObject = item;
mConfigObject = new QgsLayoutConfigObject( this, mObject );
if ( setNewItem( item ) )
{
mObject = item;
oldConfigObject->deleteLater();
return true;
}

return false;
else
{
// revert object change since it was unsuccessful
mObject = oldObject;
mConfigObject->deleteLater();
mConfigObject = oldConfigObject;
return false;
}
}

void QgsLayoutItemBaseWidget::setReportTypeString( const QString & )

0 comments on commit 0b627b3

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