File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -83,20 +83,20 @@ void QgsQmlWidgetWrapper::setQmlCode( const QString &qmlCode )
83
83
84
84
void QgsQmlWidgetWrapper::setFeature ( const QgsFeature &feature )
85
85
{
86
- if ( mWidget )
87
- {
88
- QgsExpressionContext context = layer ()->createExpressionContext ();
89
- context << QgsExpressionContextUtils::globalScope ()
90
- << QgsExpressionContextUtils::projectScope ( QgsProject::instance () )
91
- << QgsExpressionContextUtils::layerScope ( layer () );
86
+ if ( !mWidget )
87
+ return ;
92
88
93
- context.setFeature ( feature );
89
+ QgsExpressionContext context = layer ()->createExpressionContext ();
90
+ context << QgsExpressionContextUtils::globalScope ()
91
+ << QgsExpressionContextUtils::projectScope ( QgsProject::instance () )
92
+ << QgsExpressionContextUtils::layerScope ( layer () );
94
93
95
- QmlExpression *qmlExpression = new QmlExpression ();
96
- qmlExpression->setExpressionContext ( context );
94
+ context.setFeature ( feature );
97
95
98
- mWidget ->rootContext ()->setContextProperty ( " expression" , qmlExpression );
99
- }
96
+ QmlExpression *qmlExpression = new QmlExpression ();
97
+ qmlExpression->setExpressionContext ( context );
98
+
99
+ mWidget ->rootContext ()->setContextProperty ( " expression" , qmlExpression );
100
100
}
101
101
102
102
void QmlExpression::setExpressionContext ( const QgsExpressionContext &context )
You can’t perform that action at this time.
0 commit comments