Skip to content

Commit c30d7b9

Browse files
committedMay 2, 2017
Fix docstrings
1 parent 48b55a7 commit c30d7b9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
 

‎src/core/qgsexpressioncontext.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class CORE_EXPORT QgsExpressionContextScope
126126
* \param name variable name (should be unique within the QgsExpressionContextScope)
127127
* \param value initial variable value
128128
* \param readOnly true if variable should not be editable by users
129+
* \param isStatic true if the variable will not change during the lifteime of an iterator.
129130
*/
130131
StaticVariable( const QString &name = QString(), const QVariant &value = QVariant(), bool readOnly = false, bool isStatic = false )
131132
: name( name )
@@ -164,10 +165,10 @@ class CORE_EXPORT QgsExpressionContextScope
164165
*/
165166
QString name() const { return mName; }
166167

167-
/** Convenience method for setting a variable in the context scope by name and value. If a variable
168+
/** Convenience method for setting a variable in the context scope by \a name name and \a value. If a variable
168169
* with the same name is already set then its value is overwritten, otherwise a new variable is added to the scope.
169-
* \param name variable name
170-
* \param value variable value
170+
* If the \a isStatic parameter is set to true, this variable can be cached during the execution
171+
* of QgsExpression::prepare().
171172
* \see addVariable()
172173
*/
173174
void setVariable( const QString &name, const QVariant &value, bool isStatic = false );

‎tests/src/core/testqgsexpressioncontext.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ class TestQgsExpressionContext : public QObject
111111
return new ModifiableFunction( mVal );
112112
}
113113

114+
/**
115+
* This function is not static, it's value changes with every invocation.
116+
*/
114117
virtual bool isStatic( const QgsExpression::NodeFunction *node, QgsExpression *parent, const QgsExpressionContext *context ) const override
115118
{
119+
Q_UNUSED( node )
120+
Q_UNUSED( parent )
121+
Q_UNUSED( context )
116122
return false;
117123
}
118124

0 commit comments

Comments
 (0)
Please sign in to comment.