Skip to content
Permalink
Browse files

New method to add a scope to the current context

  • Loading branch information
pblottiere committed Apr 26, 2018
1 parent 4f4844f commit b13ba37279f0b252db2967b782a54c3ea8f81659
@@ -36,6 +36,15 @@ only when editing in the line edit is finished (focus lost, enter key pressed).
void setExpressionDialogTitle( const QString &title );
%Docstring
define the title used in the expression dialog
%End

void appendScope( QgsExpressionContextScope *scope /Transfer/ );
%Docstring
Appends a scope to the current expression context.

:param scope: The scope to add.

.. versionadded:: 3.2
%End

const QString expressionDialogTitle();
@@ -346,3 +346,8 @@ bool QgsFieldExpressionWidget::isExpressionValid( const QString &expressionStr )
expression.prepare( &mExpressionContext );
return !expression.hasParserError();
}

void QgsFieldExpressionWidget::appendScope( QgsExpressionContextScope *scope )
{
mExpressionContext.appendScope( scope );
}
@@ -60,6 +60,15 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
//! define the title used in the expression dialog
void setExpressionDialogTitle( const QString &title );

/**
* Appends a scope to the current expression context.
*
* \param scope The scope to add.
*
* \since QGIS 3.2
*/
void appendScope( QgsExpressionContextScope *scope SIP_TRANSFER );

//! return the title used for the expression dialog
const QString expressionDialogTitle() { return mExpressionDialogTitle; }

0 comments on commit b13ba37

Please sign in to comment.
You can’t perform that action at this time.