File tree 3 files changed +26
-0
lines changed
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,15 @@ Will select all text when this widget receives the focus.
213
213
.. versionadded:: 3.0
214
214
%End
215
215
216
+
217
+ virtual bool event( QEvent *event );
218
+ %Docstring
219
+ Reimplemented to enable/disable the clear action
220
+ depending on read-only status
221
+
222
+ .. versionadded:: 3.0.1
223
+ %End
224
+
216
225
public slots:
217
226
218
227
virtual void clearValue();
Original file line number Diff line number Diff line change @@ -178,3 +178,11 @@ bool QgsFilterLineEdit::shouldShowClear() const
178
178
}
179
179
return false ; // avoid warnings
180
180
}
181
+
182
+ bool QgsFilterLineEdit::event ( QEvent *event )
183
+ {
184
+ if ( event->type () == QEvent::ReadOnlyChange )
185
+ updateClearIcon ();
186
+
187
+ return QLineEdit::event ( event );;
188
+ }
Original file line number Diff line number Diff line change @@ -213,6 +213,15 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
213
213
*/
214
214
void setSelectOnFocus ( bool selectOnFocus );
215
215
216
+
217
+ /* *
218
+ * Reimplemented to enable/disable the clear action
219
+ * depending on read-only status
220
+ *
221
+ * \since QGIS 3.0.1
222
+ */
223
+ virtual bool event ( QEvent *event ) override ;
224
+
216
225
public slots:
217
226
218
227
/* *
You can’t perform that action at this time.
0 commit comments