Skip to content
Permalink
Browse files
Expose correct expression context
  • Loading branch information
nyalldawson committed Jun 25, 2021
1 parent 2a9c32b commit bcca0bafdc8b4983d50ddabea30e748799967626
Showing with 8 additions and 1 deletion.
  1. +6 −0 src/app/qgslayerstylingwidget.cpp
  2. +2 −1 src/gui/qgspropertyoverridebutton.cpp
@@ -566,6 +566,12 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
{
QgsRasterTransparencyWidget *transwidget = new QgsRasterTransparencyWidget( rlayer, mMapCanvas, mWidgetStack );
transwidget->setDockMode( true );

QgsSymbolWidgetContext context;
context.setMapCanvas( mMapCanvas );
context.setMessageBar( mMessageBar );
transwidget->setContext( context );

connect( transwidget, &QgsPanelWidget::widgetChanged, this, &QgsLayerStylingWidget::autoApply );
mWidgetStack->setMainPanel( transwidget );
break;
@@ -721,7 +721,8 @@ void QgsPropertyOverrideButton::showAssistant()
} );

// if the source layer is removed, we need to dismiss the assistant immediately
connect( mVectorLayer, &QObject::destroyed, widget, &QgsPanelWidget::acceptPanel );
if ( mVectorLayer )
connect( mVectorLayer, &QObject::destroyed, widget, &QgsPanelWidget::acceptPanel );

connect( widget, &QgsPropertyAssistantWidget::panelAccepted, this, [ = ] { updateGui(); } );

0 comments on commit bcca0ba

Please sign in to comment.