Skip to content

Commit

Permalink
Expose correct expression context
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 25, 2021
1 parent 2a9c32b commit bcca0ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/qgslayerstylingwidget.cpp
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgspropertyoverridebutton.cpp
Expand Up @@ -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(); } );

Expand Down

0 comments on commit bcca0ba

Please sign in to comment.