File tree Expand file tree Collapse file tree 6 files changed +86
-4
lines changed Expand file tree Collapse file tree 6 files changed +86
-4
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,24 @@ class QgsAttributeEditorContainer : QgsAttributeEditorElement
217
217
* @note Added in QGIS 3.0
218
218
*/
219
219
virtual QgsAttributeEditorElement* clone(QgsAttributeEditorElement* parent) const /Factory/;
220
+
221
+ /**
222
+ * The visibility expression is used in the attribute form to
223
+ * show or hide this container based on an expression incorporating
224
+ * the field value controlled by editor widgets.
225
+ *
226
+ * @note Added in QGIS 3.0
227
+ */
228
+ QgsOptionalExpression visibilityExpression() const;
229
+
230
+ /**
231
+ * The visibility expression is used in the attribute form to
232
+ * show or hide this container based on an expression incorporating
233
+ * the field value controlled by editor widgets.
234
+ *
235
+ * @note Added in QGIS 3.0
236
+ */
237
+ void setVisibilityExpression( const QgsOptionalExpression& visibilityExpression );
220
238
};
221
239
222
240
/** \ingroup core
Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ class QgsFieldExpressionWidget : QWidget
53
53
*/
54
54
QString asExpression() const;
55
55
56
+ /**
57
+ * Returns the currently selected field or expression. If a field is currently selected, the returned
58
+ * value will be converted to a valid expression referencing this field (ie enclosing the field name with
59
+ * appropriate quotations).
60
+ *
61
+ * Alias for asExpression()
62
+ *
63
+ * @note added in QGIS 3.0
64
+ */
65
+ QString expression() const;
66
+
56
67
//! Returns the currently used layer
57
68
QgsVectorLayer* layer() const;
58
69
@@ -87,6 +98,14 @@ class QgsFieldExpressionWidget : QWidget
87
98
//! sets the current field or expression in the widget
88
99
void setField( const QString &fieldName );
89
100
101
+ /**
102
+ * Sets the current expression text and if applicable also the field.
103
+ * Alias for setField.
104
+ *
105
+ * @note Added in QGIS 3.0
106
+ */
107
+ void setExpression( const QString& expression );
108
+
90
109
protected slots:
91
110
//! open the expression dialog to edit the current or add a new expression
92
111
void editExpression();
Original file line number Diff line number Diff line change @@ -64,6 +64,21 @@ class QgsTabWidget : QTabWidget
64
64
*/
65
65
int realTabIndex( QWidget* widget );
66
66
67
+ /**
68
+ * Is called internally whenever a new tab has been inserted.
69
+ *
70
+ * Is used to keep track of currently available and visible tabs.
71
+ *
72
+ * @note Added in QGIS 3.0
73
+ */
67
74
virtual void tabInserted( int index );
75
+
76
+ /**
77
+ * Is called internally whenever a tab has been removed.
78
+ *
79
+ * Is used to keep track of currently available and visible tabs.
80
+ *
81
+ * @note Added in QGIS 3.0
82
+ */
68
83
virtual void tabRemoved( int index );
69
84
};
Original file line number Diff line number Diff line change @@ -220,7 +220,22 @@ class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorElement
220
220
*/
221
221
virtual QgsAttributeEditorElement* clone ( QgsAttributeEditorElement* parent ) const override ;
222
222
223
+ /* *
224
+ * The visibility expression is used in the attribute form to
225
+ * show or hide this container based on an expression incorporating
226
+ * the field value controlled by editor widgets.
227
+ *
228
+ * @note Added in QGIS 3.0
229
+ */
223
230
QgsOptionalExpression visibilityExpression () const ;
231
+
232
+ /* *
233
+ * The visibility expression is used in the attribute form to
234
+ * show or hide this container based on an expression incorporating
235
+ * the field value controlled by editor widgets.
236
+ *
237
+ * @note Added in QGIS 3.0
238
+ */
224
239
void setVisibilityExpression ( const QgsOptionalExpression& visibilityExpression );
225
240
226
241
private:
Original file line number Diff line number Diff line change 16
16
#ifndef QGSOPTIONAL_H
17
17
#define QGSOPTIONAL_H
18
18
19
+
19
20
/* *
20
21
* \ingroup core
21
22
*
22
- * \brief
23
- * QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
23
+ * \brief QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
24
24
*
25
25
* Often it is used for configuration options which can be enabled or disabled but also have
26
26
* more internal configuration information that should not be lost when disabling and re-enabling.
Original file line number Diff line number Diff line change @@ -66,8 +66,23 @@ class GUI_EXPORT QgsTabWidget : public QTabWidget
66
66
*/
67
67
int realTabIndex ( QWidget* widget );
68
68
69
- virtual void tabInserted ( int index );
70
- virtual void tabRemoved ( int index );
69
+ /* *
70
+ * Is called internally whenever a new tab has been inserted.
71
+ *
72
+ * Is used to keep track of currently available and visible tabs.
73
+ *
74
+ * @note Added in QGIS 3.0
75
+ */
76
+ virtual void tabInserted ( int index ) override ;
77
+
78
+ /* *
79
+ * Is called internally whenever a tab has been removed.
80
+ *
81
+ * Is used to keep track of currently available and visible tabs.
82
+ *
83
+ * @note Added in QGIS 3.0
84
+ */
85
+ virtual void tabRemoved ( int index ) override ;
71
86
72
87
private:
73
88
void synchronizeIndexes ();
You can’t perform that action at this time.
0 commit comments