Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix crash when editing graduated symbol in style dock
- Loading branch information
|
@@ -28,6 +28,7 @@ Symbol selector widget that can be used to select and build a symbol |
|
|
%End |
|
|
public: |
|
|
|
|
|
|
|
|
QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 ); |
|
|
%Docstring |
|
|
Symbol selector widget that can be used to select and build a symbol |
|
|
|
@@ -548,6 +548,8 @@ void QgsCategorizedSymbolRendererWidget::changeCategorizedSymbol() |
|
|
std::unique_ptr<QgsSymbol> newSymbol( mCategorizedSymbol->clone() ); |
|
|
if ( panel && panel->dockMode() ) |
|
|
{ |
|
|
// bit tricky here - the widget doesn't take ownership of the symbol. So we need it to last for the duration of the |
|
|
// panel's existence. Accordingly, just kinda give it ownership here, and clean up in cleanUpSymbolSelector |
|
|
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( newSymbol.release(), mStyle, mLayer, panel ); |
|
|
dlg->setContext( mContext ); |
|
|
connect( dlg, &QgsPanelWidget::widgetChanged, this, &QgsCategorizedSymbolRendererWidget::updateSymbolsFromWidget ); |
|
|
|
@@ -977,7 +977,9 @@ void QgsGraduatedSymbolRendererWidget::changeRangeSymbol( int rangeIdx ) |
|
|
QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this ); |
|
|
if ( panel && panel->dockMode() ) |
|
|
{ |
|
|
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( newSymbol.get(), mStyle, mLayer, panel ); |
|
|
// bit tricky here - the widget doesn't take ownership of the symbol. So we need it to last for the duration of the |
|
|
// panel's existence. Accordingly, just kinda give it ownership here, and clean up in cleanUpSymbolSelector |
|
|
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( newSymbol.release(), mStyle, mLayer, panel ); |
|
|
dlg->setContext( mContext ); |
|
|
connect( dlg, &QgsPanelWidget::widgetChanged, this, &QgsGraduatedSymbolRendererWidget::updateSymbolsFromWidget ); |
|
|
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsGraduatedSymbolRendererWidget::cleanUpSymbolSelector ); |
|
|
|
@@ -93,6 +93,8 @@ class GUI_EXPORT QgsSymbolSelectorWidget: public QgsPanelWidget, private Ui::Qgs |
|
|
|
|
|
public: |
|
|
|
|
|
// TODO QGIS 4.0 - transfer ownership of symbol to widget! |
|
|
|
|
|
/** |
|
|
* Symbol selector widget that can be used to select and build a symbol |
|
|
* \param symbol The symbol to load into the widget as a start point. |
|
|