Skip to content

Commit

Permalink
fix(raster-temporal-properties): add global contexts to start/end dat…
Browse files Browse the repository at this point in the history
…e expression

As a result, variables like @layer_name can be used now.
  • Loading branch information
Djedouas committed Jan 14, 2025
1 parent 9f055dd commit 49d7cf2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/raster/qgsrasterlayertemporalpropertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ void QgsRasterLayerTemporalPropertiesWidget::calculateRangeByExpression( bool is
bandScope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "band_description" ), mLayer->dataProvider()->bandDescription( 1 ), true, false, tr( "Band description" ) ) );

expressionContext.appendScope( bandScope );
expressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mLayer ) );
expressionContext.setHighlightedVariables( { QStringLiteral( "band" ), QStringLiteral( "band_name" ), QStringLiteral( "band_description" ) } );

QgsExpressionBuilderDialog dlg = QgsExpressionBuilderDialog( nullptr, isUpper ? mFixedRangeUpperExpression : mFixedRangeLowerExpression, this, QStringLiteral( "generic" ), expressionContext );
Expand Down

0 comments on commit 49d7cf2

Please sign in to comment.