2017-05-23 14:44:34 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsexpressionlineedit.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
class QgsExpressionLineEdit : QWidget
|
|
|
|
{
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
The QgsExpressionLineEdit widget includes a line edit for entering expressions
|
2017-12-15 10:36:55 -04:00
|
|
|
together with a button to open the expression creation dialog.
|
2017-05-23 14:44:34 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
This widget is designed for use in contexts where no layer fields are available for
|
|
|
|
use in an expression. In contexts where the expression is directly associated with
|
|
|
|
a layer and fields can be used, then QgsFieldExpressionWidget is a more appropriate
|
|
|
|
choice as it gives users direct access to select fields from a drop-down list.
|
2017-05-23 14:44:34 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
QgsExpressionLineEdit also supports a multiline editor mode which is useful where
|
|
|
|
more space is available for the widget, but where QgsExpressionBuilderWidget
|
|
|
|
is too complex or large for use.
|
2017-05-23 14:44:34 +02:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
2016-08-18 20:49:19 +10:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsexpressionlineedit.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-05-02 07:21:20 +02:00
|
|
|
explicit QgsExpressionLineEdit( QWidget *parent /TransferThis/ = 0 );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsExpressionLineEdit.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param parent: parent widget
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2019-04-04 15:44:58 -05:00
|
|
|
~QgsExpressionLineEdit();
|
2017-05-23 14:44:34 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setExpressionDialogTitle( const QString &title );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the title used in the expression builder dialog
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param title: dialog title
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`expressionDialogTitle`
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
QString expressionDialogTitle() const;
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the title used for the expression dialog.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setExpressionDialogTitle`
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
void setMultiLine( bool multiLine );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether the widget should show a multiline text editor.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:param multiLine: set to ``True`` to show multiline editor, or ``False``
|
2018-05-24 21:21:14 +10:00
|
|
|
to show single line editor (the default).
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
2018-09-05 17:49:06 +10:00
|
|
|
QString expectedOutputFormat() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the expected format string, which is shown in the expression builder dialog for the widget.
|
|
|
|
This is purely a text format and no expression validation
|
|
|
|
is done against it.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setExpectedOutputFormat`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setExpectedOutputFormat( const QString &expected );
|
|
|
|
%Docstring
|
|
|
|
Set the ``expected`` format string, which is shown in the expression builder dialog for the widget.
|
|
|
|
This is purely a text format and no expression validation is done against it.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`expectedOutputFormat`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2016-08-18 20:49:19 +10:00
|
|
|
void setGeomCalculator( const QgsDistanceArea &distanceArea );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the geometry calculator used in the expression dialog.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param distanceArea: calculator
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setLayer( QgsVectorLayer *layer );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets a layer associated with the widget. Required in order to get the fields and values
|
|
|
|
from the layer.
|
|
|
|
This will also automatically register the layer as expression context generator if
|
|
|
|
no generator has been set before or the previous layer has been used as generator.
|
2017-05-23 14:44:34 +02:00
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`registerExpressionContextGenerator`
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
QString expression() const;
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current expression shown in the widget.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setExpression`
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
2017-05-02 07:21:20 +02:00
|
|
|
bool isValidExpression( QString *expressionError /Out/ = 0 ) const;
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2018-12-19 08:04:27 -04:00
|
|
|
Determines if the current expression is valid.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-12-19 08:04:27 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: - ``True`` if the current expression is valid.
|
2019-02-04 08:26:11 +10:00
|
|
|
- expressionError: will be set to any generated error message
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void registerExpressionContextGenerator( const QgsExpressionContextGenerator *generator );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Register an expression context generator class that will be used to retrieve
|
|
|
|
an expression context for the widget.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param generator: A QgsExpressionContextGenerator class that will be used to
|
2018-05-24 21:21:14 +10:00
|
|
|
create an expression context when required.
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void expressionChanged( const QString &expression );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the expression is changed.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param expression: new expression
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void setExpression( const QString &expression );
|
2017-05-23 14:44:34 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current expression to show in the widget.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param expression: expression string
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`expression`
|
2017-05-23 14:44:34 +02:00
|
|
|
%End
|
2016-08-18 20:49:19 +10:00
|
|
|
|
|
|
|
protected:
|
2017-05-23 14:44:34 +02:00
|
|
|
|
|
|
|
virtual void changeEvent( QEvent *event );
|
|
|
|
|
|
|
|
|
2016-08-18 20:49:19 +10:00
|
|
|
};
|
2017-05-23 14:44:34 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsexpressionlineedit.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|