@@ -54,35 +54,44 @@ class GUI_EXPORT QgsExpressionLineEdit : public QWidget
54
54
*/
55
55
explicit QgsExpressionLineEdit ( QWidget *parent = nullptr );
56
56
57
- /* * Sets the title used in the expression builder dialog
57
+ /* *
58
+ * Sets the title used in the expression builder dialog
58
59
* @param title dialog title
59
60
* @see expressionDialogTitle()
60
61
*/
61
62
void setExpressionDialogTitle ( const QString& title );
62
63
63
- /* * Returns the title used for the expression dialog.
64
+ /* *
65
+ * Returns the title used for the expression dialog.
64
66
* @see setExpressionDialogTitle()
65
67
*/
66
68
QString expressionDialogTitle () const { return mExpressionDialogTitle ; }
67
69
68
- /* * Sets whether the widget should show a multiline text editor.
70
+ /* *
71
+ * Sets whether the widget should show a multiline text editor.
69
72
* @param multiLine set to true to show multiline editor, or false
70
73
* to show single line editor (the default).
71
74
*/
72
75
void setMultiLine ( bool multiLine );
73
76
74
- /* * Set the geometry calculator used in the expression dialog.
77
+ /* *
78
+ * Set the geometry calculator used in the expression dialog.
75
79
* @param distanceArea calculator
76
80
*/
77
81
void setGeomCalculator ( const QgsDistanceArea &distanceArea );
78
82
79
- /* * Sets a layer associated with the widget. Required in order to get the fields and values
80
- * from the layer.
81
- * @param layer vector layer
82
- */
83
+ /* *
84
+ * Sets a layer associated with the widget. Required in order to get the fields and values
85
+ * from the layer.
86
+ * This will also automatically register the layer as expression context generator if
87
+ * no generator has been set before or the previous layer has been used as generator.
88
+ *
89
+ * @see registerExpressionContextGenerator
90
+ */
83
91
void setLayer ( QgsVectorLayer* layer );
84
92
85
- /* * Returns the current expression shown in the widget.
93
+ /* *
94
+ * Returns the current expression shown in the widget.
86
95
* @see setExpression()
87
96
*/
88
97
QString expression () const ;
@@ -110,16 +119,19 @@ class GUI_EXPORT QgsExpressionLineEdit : public QWidget
110
119
111
120
public slots:
112
121
113
- /* * Sets the current expression to show in the widget.
122
+ /* *
123
+ * Sets the current expression to show in the widget.
114
124
* @param expression expression string
115
125
* @see expression()
116
126
*/
117
127
void setExpression ( const QString& expression );
118
128
119
129
protected:
130
+
120
131
void changeEvent ( QEvent* event ) override ;
121
132
122
133
private slots:
134
+
123
135
// ! When the expression is edited by the user in the line edit, it will be checked for validity
124
136
void expressionEdited ( const QString& expression );
125
137
void expressionEdited ();
2 commit comments
nyalldawson commentedon Oct 5, 2016
@m-kuhn this was deliberate - the calculation of default value does not have access to other field's values from the feature.
m-kuhn commentedon Oct 5, 2016
Oops, good point. I wondered that you would have missed something like that...