Skip to content
Permalink
Browse files

Cleanup symbol definition widgets when switching between symbol layers

Fix #13549
  • Loading branch information
m-kuhn committed Oct 10, 2015
1 parent a721752 commit b82c146cdb5e4a1125ae5a8207b1dfee6752f6a1
@@ -118,6 +118,13 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty
btnColor->setContext( "symbology" );
}

QgsSymbolsListWidget::~QgsSymbolsListWidget()
{
// This action was added to the menu by this widget, clean it up
// The menu can be passed in the constructor, so may live longer than this widget
btnAdvanced->menu()->removeAction( mClipFeaturesAction );
}

void QgsSymbolsListWidget::setMapCanvas( QgsMapCanvas* canvas )
{
mMapCanvas = canvas;
@@ -32,12 +32,16 @@ class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListW
public:
QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* style, QMenu* menu, QWidget* parent, const QgsVectorLayer * layer = 0 );

//! Destructor
virtual ~QgsSymbolsListWidget();

/** Returns the expression context used for the widget, if set. This expression context is used for
* evaluating data defined symbol properties and for populating based expression widgets in
* the list widget.
* @note added in QGIS 2.12
* @see setExpressionContext()
*/

QgsExpressionContext* expressionContext() const { return mPresetExpressionContext; }

/** Sets the map canvas associated with the widget. This allows the widget to retrieve the current
@@ -472,13 +472,8 @@ void QgsSymbolV2SelectorDialog::setWidget( QWidget* widget )
{
int index = stackedWidget->addWidget( widget );
stackedWidget->setCurrentIndex( index );
if ( mPresentWidget )
{
stackedWidget->removeWidget( mPresentWidget );
QWidget *dummy = mPresentWidget;
mPresentWidget = widget;
delete dummy; // auto disconnects all signals
}
delete mPresentWidget;
mPresentWidget = widget;
}

void QgsSymbolV2SelectorDialog::updateLockButton()

0 comments on commit b82c146

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