Skip to content
Permalink
Browse files

Fix messed up undo/redo when changing picture type

  • Loading branch information
nyalldawson committed Mar 19, 2020
1 parent 73efe64 commit 61e9ffeb6837ac64da37de365f9160fb3b63d70a
Showing with 6 additions and 0 deletions.
  1. +5 −0 src/gui/layout/qgslayoutpicturewidget.cpp
  2. +1 −0 src/gui/layout/qgslayoutpicturewidget.h
@@ -338,6 +338,7 @@ void QgsLayoutPictureWidget::setGuiElementValues()
{
whileBlocking( mSvgSourceLineEdit )->setSource( mPicture->picturePath() );

mBlockSvgModelChanges++;
QAbstractItemModel *m = viewImages->model();
QItemSelectionModel *selModel = viewImages->selectionModel();
for ( int i = 0; i < m->rowCount(); i++ )
@@ -350,6 +351,7 @@ void QgsLayoutPictureWidget::setGuiElementValues()
break;
}
}
mBlockSvgModelChanges--;
}
else if ( mRadioRaster->isChecked() )
{
@@ -537,6 +539,9 @@ void QgsLayoutPictureWidget::populateIcons( const QModelIndex &idx )

void QgsLayoutPictureWidget::setSvgName( const QModelIndex &idx )
{
if ( mBlockSvgModelChanges )
return;

QString name = idx.data( Qt::UserRole ).toString();
whileBlocking( mSvgSourceLineEdit )->setSource( name );
svgSourceChanged( name );
@@ -82,6 +82,7 @@ class GUI_EXPORT QgsLayoutPictureWidget: public QgsLayoutItemBaseWidget, private
QPointer< QgsLayoutItemPicture > mPicture;
QgsLayoutItemPropertiesWidget *mItemPropertiesWidget = nullptr;
int mIconSize = 30;
int mBlockSvgModelChanges = 0;

void updateSvgParamGui( bool resetValues = true );
};

0 comments on commit 61e9ffe

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