Skip to content

Commit

Permalink
Check if maskingWidget has been populated to effectively apply the ch…
Browse files Browse the repository at this point in the history
…ange. Should fix issue #37473.
  • Loading branch information
obrix authored and nyalldawson committed Jul 13, 2020
1 parent f5b56e3 commit fb9d158
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/gui/qgsmaskingwidget.cpp
Expand Up @@ -332,3 +332,8 @@ void QgsMaskingWidget::apply()
layer->triggerRepaint();
}
}

bool QgsMaskingWidget::hasBeenPopulated()
{
return mMustPopulate == false;
}
2 changes: 2 additions & 0 deletions src/gui/qgsmaskingwidget.h
Expand Up @@ -47,6 +47,8 @@ class GUI_EXPORT QgsMaskingWidget: public QgsPanelWidget, private Ui::QgsMasking
//! Applies the changes
void apply();

bool hasBeenPopulated();

signals:
//! Emitted when a change is performed
void widgetChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/vector/qgsvectorlayerproperties.cpp
Expand Up @@ -607,7 +607,7 @@ void QgsVectorLayerProperties::apply()
mMetadataFilled = false;

// save masking settings
if ( mMaskingWidget )
if ( mMaskingWidget && mMaskingWidget->hasBeenPopulated() )
mMaskingWidget->apply();

//
Expand Down

0 comments on commit fb9d158

Please sign in to comment.