18 #ifndef QGSFILTERLINEEDIT_H 19 #define QGSFILTERLINEEDIT_H 44 if ( qobject_cast<QgsFilterLineEdit *>( sipCpp ) )
45 sipType = sipType_QgsFilterLineEdit;
52 Q_PROPERTY(
ClearMode clearMode READ clearMode WRITE setClearMode )
53 Q_PROPERTY( QString nullValue READ nullValue WRITE setNullValue )
54 Q_PROPERTY( QString defaultValue READ defaultValue WRITE setDefaultValue )
55 Q_PROPERTY( QString value READ value WRITE setValue NOTIFY valueChanged )
56 Q_PROPERTY(
bool showClearButton READ showClearButton WRITE setShowClearButton )
57 Q_PROPERTY(
bool showSearchIcon READ showSearchIcon WRITE setShowSearchIcon )
58 Q_PROPERTY(
bool showSpinner READ showSpinner WRITE setShowSpinner NOTIFY showSpinnerChanged )
90 void setShowClearButton(
bool visible );
115 void setNullValue(
const QString &nullValue ) { mNullValue = nullValue; }
130 void setShowSearchIcon(
bool visible );
167 void setValue(
const QString &value ) { setText( value.isNull() ? mNullValue : value ); }
177 QString
value()
const {
return isNull() ? QString() : text(); }
185 inline bool isNull()
const {
return text() == mNullValue; }
193 bool showSpinner()
const;
201 void setShowSpinner(
bool showSpinner );
208 bool selectOnFocus()
const;
215 void setSelectOnFocus(
bool selectOnFocus );
224 bool event( QEvent *event )
override;
233 virtual void clearValue();
248 void valueChanged(
const QString &value );
256 void showSpinnerChanged();
264 void selectOnFocusChanged();
267 void focusInEvent( QFocusEvent *e )
override;
268 void mouseReleaseEvent( QMouseEvent *e )
override;
271 void onTextChanged(
const QString &text );
272 void updateBusySpinner();
273 void updateClearIcon();
277 QAction *mClearAction =
nullptr;
278 QAction *mSearchAction =
nullptr;
279 QAction *mBusySpinnerAction =
nullptr;
281 bool mClearButtonVisible =
true;
282 bool mShowSpinner =
false;
287 QString mDefaultValue;
289 bool mWaitingForMouseRelease =
false;
290 bool mSelectOnFocus =
false;
295 bool shouldShowClear()
const;
297 friend class TestQgsFeatureListComboBox;
314 QgsSpinBoxLineEdit( QWidget *parent =
nullptr )
320 void clearValue()
override 323 setCursor( Qt::IBeamCursor );
329 void focusInEvent( QFocusEvent *e )
override;
333 #endif // QGSFILTERLINEEDIT_H ClearMode clearMode() const
Returns the clear mode for the widget.
bool showClearButton() const
Returns true if the widget's clear button is visible.
void setDefaultValue(const QString &defaultValue)
Sets the default value for the widget.
bool showSearchIcon() const
Returns if a search icon shall be shown on the left of the image when no text is entered.
QString defaultValue() const
Returns the default value for the widget.
void setClearMode(ClearMode mode)
Sets the clear mode for the widget.
Reset value to default value (see defaultValue() )
QString nullValue() const
Returns the string used for representating null values in the widget.
ClearMode
Behavior when clearing value of widget.
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Animated icon is keeping an animation running if there are listeners connected to frameChanged...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
bool isNull() const
Determine if the current text represents null.
void setNullValue(const QString &nullValue)
Sets the string representation for null values in the widget.
void setValue(const QString &value)
Sets the current text for the widget with support for handling null values.
QString value() const
Returns the text of this edit with support for handling null values.