[symbology][gui] Fix symbol selector dialog not passing on its context to its widget

This commit is contained in:
Mathieu Pellerin 2025-02-06 17:25:02 +07:00 committed by Nyall Dawson
parent c004c6662b
commit 48b7079375
2 changed files with 6 additions and 3 deletions

View File

@ -417,9 +417,13 @@ void QgsSymbolSelectorWidget::setContext( const QgsSymbolWidgetContext &context
QWidget *widget = stackedWidget->currentWidget();
if ( QgsLayerPropertiesWidget *layerProp = qobject_cast<QgsLayerPropertiesWidget *>( widget ) )
{
layerProp->setContext( context );
}
else if ( QgsSymbolsListWidget *listWidget = qobject_cast<QgsSymbolsListWidget *>( widget ) )
{
listWidget->setContext( context );
}
layerChanged();
updatePreview();
@ -872,12 +876,12 @@ QMenu *QgsSymbolSelectorDialog::advancedMenu()
void QgsSymbolSelectorDialog::setContext( const QgsSymbolWidgetContext &context )
{
mContext = context;
mSelectorWidget->setContext( context );
}
QgsSymbolWidgetContext QgsSymbolSelectorDialog::context() const
{
return mContext;
return mSelectorWidget->context();
}
QgsSymbol *QgsSymbolSelectorDialog::symbol()

View File

@ -398,7 +398,6 @@ class GUI_EXPORT QgsSymbolSelectorDialog : public QDialog
QgsSymbolSelectorWidget *mSelectorWidget = nullptr;
QDialogButtonBox *mButtonBox = nullptr;
QgsSymbolWidgetContext mContext;
};
#endif