Skip to content

Commit

Permalink
Set the expression context for map canvas renders
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 22, 2015
1 parent 0cab6b3 commit cf22025
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,12 @@ void QgsMapCanvas::refreshMap()
//update $map variable to canvas
QgsExpression::setSpecialColumn( "$map", tr( "canvas" ) );

//build the expression context
QgsExpressionContext expressionContext;
expressionContext << QgsExpressionContextUtils::globalScope()
<< QgsExpressionContextUtils::projectScope();
mSettings.setExpressionContext( expressionContext );

// create the renderer job
Q_ASSERT( mJob == 0 );
mJobCancelled = false;
Expand Down

0 comments on commit cf22025

Please sign in to comment.