Skip to content
Permalink
Browse files

Fix effect preview picture not set when effect widget is opened in di…

…alog mode

Also fix a memory leak when opened in dialog mode

Fixes #33600

(cherry picked from commit 449bc4b)
  • Loading branch information
nyalldawson committed Jan 5, 2020
1 parent 3b4c336 commit 0f7cdac44f09fc69f0c5a7ed80f5d758be6acbb0
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/gui/effects/qgseffectstackpropertieswidget.cpp
@@ -470,22 +470,27 @@ void QgsEffectStackCompactWidget::showDialog()
return;

QgsEffectStack *clone = mStack->clone();
QgsEffectStackPropertiesWidget *widget = new QgsEffectStackPropertiesWidget( clone, nullptr );
if ( mPreviewPicture )
{
widget->setPreviewPicture( *mPreviewPicture );
}

QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( qobject_cast< QWidget * >( parent() ) );
if ( panel && panel->dockMode() )
{
QgsEffectStackPropertiesWidget *widget = new QgsEffectStackPropertiesWidget( clone, nullptr );
if ( mPreviewPicture )
{
widget->setPreviewPicture( *mPreviewPicture );
}

connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsEffectStackCompactWidget::updateEffectLive );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsEffectStackCompactWidget::updateAcceptWidget );
panel->openPanel( widget );
}
else
{
QgsEffectStackPropertiesDialog dlg( clone, this );
if ( mPreviewPicture )
{
dlg.setPreviewPicture( *mPreviewPicture );
}

if ( dlg.exec() == QDialog::Accepted )
{
*mStack = *clone;

0 comments on commit 0f7cdac

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