@@ -39,6 +39,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
39
39
Q_PROPERTY ( QString nullValue READ nullValue WRITE setNullValue )
40
40
Q_PROPERTY ( QString defaultValue READ defaultValue WRITE setDefaultValue )
41
41
Q_PROPERTY ( QString value READ value WRITE setValue NOTIFY valueChanged )
42
+ Q_PROPERTY ( bool showClearButton READ showClearButton WRITE setShowClearButton )
42
43
43
44
public:
44
45
@@ -55,15 +56,30 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
55
56
*/
56
57
QgsFilterLineEdit ( QWidget* parent = nullptr , const QString& nullValue = QString::null );
57
58
59
+ /* * Returns true if the widget's clear button is visible.
60
+ * @see setShowClearButton()
61
+ * @note added in QGIS 3.0
62
+ */
63
+ bool showClearButton () const { return mClearButtonVisible ; }
64
+
65
+ /* * Sets whether the widget's clear button is visible.
66
+ * @param visible set to false to hide the clear button
67
+ * @see showClearButton()
68
+ * @note added in QGIS 3.0
69
+ */
70
+ void setShowClearButton ( bool visible );
71
+
58
72
/* * Returns the clear mode for the widget. The clear mode defines the behaviour of the
59
73
* widget when its value is cleared. This defaults to ClearToNull.
60
74
* @see setClearMode()
75
+ * @note added in QGIS 3.0
61
76
*/
62
77
ClearMode clearMode () const { return mClearMode ; }
63
78
64
79
/* * Sets the clear mode for the widget. The clear mode defines the behaviour of the
65
80
* widget when its value is cleared. This defaults to ClearToNull.
66
81
* @see clearMode()
82
+ * @note added in QGIS 3.0
67
83
*/
68
84
void setClearMode ( ClearMode mode ) { mClearMode = mode; }
69
85
@@ -87,6 +103,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
87
103
* @param defaultValue default value
88
104
* @see defaultValue()
89
105
* @see clearMode()
106
+ * @note added in QGIS 3.0
90
107
*/
91
108
void setDefaultValue ( const QString& defaultValue ) { mDefaultValue = defaultValue; }
92
109
@@ -95,6 +112,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
95
112
* is equal to ClearToDefault.
96
113
* @see setDefaultValue()
97
114
* @see clearMode()
115
+ * @note added in QGIS 3.0
98
116
*/
99
117
QString defaultValue () const { return mDefaultValue ; }
100
118
@@ -129,6 +147,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
129
147
130
148
/* * Clears the widget and resets it to the null value.
131
149
* @see nullValue()
150
+ * @note added in QGIS 3.0
132
151
*/
133
152
virtual void clearValue ();
134
153
@@ -158,6 +177,8 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
158
177
159
178
private:
160
179
180
+ bool mClearButtonVisible ;
181
+
161
182
ClearMode mClearMode ;
162
183
163
184
QString mNullValue ;
0 commit comments