/************************************************************************ * This file has been generated automatically from * * * * src/gui/qgsexpressionbuilderwidget.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ class QgsExpressionBuilderWidget : QWidget { %Docstring A reusable widget that can be used to build a expression string. See QgsExpressionBuilderDialog for example of usage. %End %TypeHeaderCode #include "qgsexpressionbuilderwidget.h" %End public: enum Flag { LoadNothing, LoadRecent, LoadUserExpressions, LoadAll, }; typedef QFlags Flags; QgsExpressionBuilderWidget( QWidget *parent /TransferThis/ = 0 ); %Docstring Create a new expression builder widget with an optional parent. %End ~QgsExpressionBuilderWidget(); void init( const QgsExpressionContext &context = QgsExpressionContext(), const QString &recentCollection = QStringLiteral( "generic" ), const Flags &flags = LoadAll ); %Docstring Initialize without any layer .. versionadded:: 3.14 %End void initWithLayer( QgsVectorLayer *layer, const QgsExpressionContext &context = QgsExpressionContext(), const QString &recentCollection = QStringLiteral( "generic" ), const Flags &flags = LoadAll ); %Docstring Initialize with a layer .. versionadded:: 3.14 %End void initWithFields( const QgsFields &fields, const QgsExpressionContext &context = QgsExpressionContext(), const QString &recentCollection = QStringLiteral( "generic" ), const Flags &flags = LoadAll ); %Docstring Initialize with given fields without any layer .. versionadded:: 3.14 %End void setLayer( QgsVectorLayer *layer ); %Docstring Sets layer in order to get the fields and values .. note:: this needs to be called before calling loadFieldNames(). %End QgsVectorLayer *layer() const; %Docstring Returns the current layer or a None. %End void loadFieldNames(); %Docstring .. deprecated:: QGIS 3.14 this is now done automatically %End void loadFieldNames( const QgsFields &fields ); %Docstring .. deprecated:: QGIS 3.14 use expressionTree()->loadFieldNames() instead %End void loadFieldsAndValues( const QMap &fieldValues ) /Deprecated/; %Docstring Loads field names and values from the specified map. .. versionadded:: 2.12 .. deprecated:: QGIS 3.14 this will not do anything, use setLayer() instead %End void setGeomCalculator( const QgsDistanceArea &da ); %Docstring Sets geometry calculator used in distance/area calculations. %End QString expressionText(); %Docstring Gets the expression string that has been set in the expression area. :return: The expression as a string. * %End void setExpressionText( const QString &expression ); %Docstring Sets the expression string for the widget %End QString expectedOutputFormat(); %Docstring The set expected format string. This is pure text format and no expression validation is done against it. :return: The expected value format. %End void setExpectedOutputFormat( const QString &expected ); %Docstring The set expected format string. This is pure text format and no expression validation is done against it. :param expected: The expected value format for the expression. .. note:: Only a UI hint and not used for expression validation. %End QgsExpressionContext expressionContext() const; %Docstring Returns the expression context for the widget. The context is used for the expression preview result and for populating the list of available functions and variables. .. seealso:: :py:func:`setExpressionContext` .. versionadded:: 2.12 %End void setExpressionContext( const QgsExpressionContext &context ); %Docstring Sets the expression context for the widget. The context is used for the expression preview result and to populate the list of available functions and variables. :param context: expression context .. seealso:: :py:func:`expressionContext` .. versionadded:: 2.12 %End bool isExpressionValid(); %Docstring Returns if the expression is valid %End void saveToRecent( const QString &collection = "generic" ) /Deprecated/; %Docstring Adds the current expression to the given ``collection``. By default it is saved to the collection "generic". .. deprecated:: QGIS 3.14 use expressionTree()->saveRecent() instead %End void loadRecent( const QString &collection = QStringLiteral( "generic" ) )/Deprecated/; %Docstring Loads the recent expressions from the given ``collection``. By default it is loaded from the collection "generic". .. deprecated:: QGIS 3.14 use expressionTree()->loadRecent() instead %End QgsExpressionTreeView *expressionTree() const; %Docstring Returns the expression tree .. versionadded:: 3.14 %End void loadUserExpressions() /Deprecated/; %Docstring Loads the user expressions. .. deprecated:: QGIS 3.14 use expressionTree()->loadUserExpressions() instead .. versionadded:: 3.12 %End void saveToUserExpressions( const QString &label, const QString expression, const QString &helpText ) /Deprecated/; %Docstring Stores the user ``expression`` with given ``label`` and ``helpText``. .. deprecated:: QGIS 3.14 use expressionTree()->saveToUserExpressions() instead .. versionadded:: 3.12 %End void removeFromUserExpressions( const QString &label ) /Deprecated/; %Docstring Removes the expression ``label`` from the user stored expressions. .. deprecated:: QGIS 3.14 use expressionTree()->removeFromUserExpressions() instead .. versionadded:: 3.12 %End void newFunctionFile( const QString &fileName = "scratch" ); %Docstring Creates a new file in the function editor %End void saveFunctionFile( QString fileName ); %Docstring Saves the current function editor text to the given file. %End void loadCodeFromFile( QString path ); %Docstring Loads code from the given file into the function editor %End void loadFunctionCode( const QString &code ); %Docstring Loads code into the function editor %End void updateFunctionFileList( const QString &path ); %Docstring Updates the list of function files found at the given path %End QStandardItemModel *model() /Deprecated/; %Docstring Returns a pointer to the dialog's function item model. This method is exposed for testing purposes only - it should not be used to modify the model. .. versionadded:: 3.0 .. deprecated:: QGIS 3.14 %End QgsProject *project(); %Docstring Returns the project currently associated with the widget. .. seealso:: :py:func:`setProject` .. versionadded:: 3.0 %End void setProject( QgsProject *project ); %Docstring Sets the ``project`` currently associated with the widget. This controls which layers and relations and other project-specific items are shown in the widget. .. seealso:: :py:func:`project` .. versionadded:: 3.0 %End bool evalError() const; %Docstring Will be set to ``True`` if the current expression text reported an eval error with the context. .. versionadded:: 3.0 %End bool parserError() const; %Docstring Will be set to ``True`` if the current expression text reports a parser error with the context. .. versionadded:: 3.0 %End public slots: void loadSampleValues(); %Docstring Load sample values into the sample value area. Including available values, in case the formatter can provide them (eg. RelationReference). %End void loadAllValues(); %Docstring Load all unique values from the set layer into the sample area. Including all available values, in case the formatter can provide them (eg. RelationReference). %End void loadSampleUsedValues(); %Docstring Load used sample values into the sample value area. Only the used ones. Without available values, even if the formatter can provide them (eg. RelationReference). .. versionadded:: 3.12 %End void loadAllUsedValues(); %Docstring Load all unique values from the set layer into the sample area. Only the used ones. Without available values, even if the formatter can provide them (eg. RelationReference). .. versionadded:: 3.12 %End void autosave(); %Docstring Auto save the current Python function code. %End void setAutoSave( bool enabled ); %Docstring Enabled or disable auto saving. When enabled Python scripts will be auto saved when text changes. :param enabled: ``True`` to enable auto saving. %End void storeCurrentUserExpression( ); %Docstring Adds the current expressions to the stored user expressions. .. versionadded:: 3.12 %End void removeSelectedUserExpression( ); %Docstring Removes the selected expression from the stored user expressions, the selected expression must be a user stored expression. .. versionadded:: 3.12 %End void editSelectedUserExpression(); %Docstring Edits the selected expression from the stored user expressions, the selected expression must be a user stored expression. .. versionadded:: 3.14 %End const QList findExpressions( const QString &label ); %Docstring Returns the list of expression items matching a ``label``. .. versionadded:: 3.12 .. deprecated:: QGIS 3.14 use expressionTree()->findExpressions instead %End signals: void expressionParsed( bool isValid ); %Docstring Emitted when the user changes the expression in the widget. Users of this widget should connect to this signal to decide if to let the user continue. :param isValid: Is ``True`` if the expression the user has typed is valid. %End void evalErrorChanged(); %Docstring Will be set to ``True`` if the current expression text reported an eval error with the context. .. versionadded:: 3.0 %End void parserErrorChanged(); %Docstring Will be set to ``True`` if the current expression text reported a parser error with the context. .. versionadded:: 3.0 %End protected: virtual void showEvent( QShowEvent *e ); public: }; /************************************************************************ * This file has been generated automatically from * * * * src/gui/qgsexpressionbuilderwidget.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/