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 virtual 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;
270 void onTextChanged(
const QString &text );
271 void updateBusySpinner();
272 void updateClearIcon();
276 QAction *mClearAction =
nullptr;
277 QAction *mSearchAction =
nullptr;
278 QAction *mBusySpinnerAction =
nullptr;
280 bool mClearButtonVisible =
true;
281 bool mShowSpinner =
false;
286 QString mDefaultValue;
288 bool mFocusInEvent =
false;
289 bool mSelectOnFocus =
false;
294 bool shouldShowClear()
const;
311 QgsSpinBoxLineEdit( QWidget *parent =
nullptr )
317 void clearValue()
override 320 setCursor( Qt::IBeamCursor );
327 #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.