File: qgsexpressionlineedit.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (164 lines) | stat: -rw-r--r-- 5,136 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsexpressionlineedit.h                                      *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsExpressionLineEdit : QWidget
{
%Docstring(signature="appended")
The :py:class:`QgsExpressionLineEdit` widget includes a line edit for
entering expressions together with a button to open the expression
creation dialog.

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
:py:class:`QgsFieldExpressionWidget` is a more appropriate choice as it
gives users direct access to select fields from a drop-down list.

:py:class:`QgsExpressionLineEdit` also supports a multiline editor mode
which is useful where more space is available for the widget, but where
:py:class:`QgsExpressionBuilderWidget` is too complex or large for use.
%End

%TypeHeaderCode
#include "qgsexpressionlineedit.h"
%End
  public:
    explicit QgsExpressionLineEdit( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsExpressionLineEdit.

:param parent: parent widget
%End
    ~QgsExpressionLineEdit();

    void setExpressionDialogTitle( const QString &title );
%Docstring
Sets the title used in the expression builder dialog

:param title: dialog title

.. seealso:: :py:func:`expressionDialogTitle`
%End

    QString expressionDialogTitle() const;
%Docstring
Returns the title used for the expression dialog.

.. seealso:: :py:func:`setExpressionDialogTitle`
%End

    void setMultiLine( bool multiLine );
%Docstring
Sets whether the widget should show a multiline text editor.

:param multiLine: set to ``True`` to show multiline editor, or ``False``
                  to show single line editor (the default).
%End

    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

    void setGeomCalculator( const QgsDistanceArea &distanceArea );
%Docstring
Set the geometry calculator used in the expression dialog.

:param distanceArea: calculator
%End

    void setLayer( QgsVectorLayer *layer );
%Docstring
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.

.. seealso:: :py:func:`registerExpressionContextGenerator`
%End

    QString expression() const;
%Docstring
Returns the current expression shown in the widget.

.. seealso:: :py:func:`setExpression`
%End

    bool isValidExpression( QString *expressionError /Out/ = 0 ) const;
%Docstring
Determines if the current expression is valid.



:return: - ``True`` if the current expression is valid.
         - expressionError: any generated error message
%End

    void registerExpressionContextGenerator( const QgsExpressionContextGenerator *generator );
%Docstring
Register an expression context generator class that will be used to
retrieve an expression context for the widget.

:param generator: A :py:class:`QgsExpressionContextGenerator` class that
                  will be used to create an expression context when
                  required.
%End

  signals:

    void expressionChanged( const QString &expression );
%Docstring
Emitted when the expression is changed.

:param expression: new expression
%End

  public slots:

    void setExpression( const QString &expression );
%Docstring
Sets the current expression to show in the widget.

:param expression: expression string

.. seealso:: :py:func:`expression`
%End

  protected:
    virtual void changeEvent( QEvent *event );


};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/qgsexpressionlineedit.h                                      *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/