18#ifndef QGSFILTERLINEEDIT_H
19#define QGSFILTERLINEEDIT_H
44 if ( qobject_cast<QgsFilterLineEdit *>( sipCpp ) )
45 sipType = sipType_QgsFilterLineEdit;
87 void setShowClearButton(
bool visible );
124 void setShowSearchIcon(
bool visible );
140 void setDefaultValue(
const QString &defaultValue );
176 inline bool isNull()
const {
return text() == mNullValue; }
183 bool showSpinner()
const;
190 void setShowSpinner(
bool showSpinner );
196 bool selectOnFocus()
const;
202 void setSelectOnFocus(
bool selectOnFocus );
209 bool event( QEvent *event )
override;
223 virtual void clearValue();
271 void onTextChanged(
const QString &text );
272 void updateBusySpinner();
273 void updateClearIcon();
286 QAction *mClearAction =
nullptr;
287 QAction *mSearchAction =
nullptr;
288 QAction *mBusySpinnerAction =
nullptr;
290 bool mClearButtonVisible =
true;
291 bool mShowSpinner =
false;
293 ClearMode mClearMode = ClearToNull;
296 QString mDefaultValue;
298 bool mWaitingForMouseRelease =
false;
299 bool mSelectOnFocus =
false;
301 LineEditState mLineEditState;
306 bool shouldShowClear()
const;
324 QgsSpinBoxLineEdit( QWidget *parent =
nullptr )
333 setCursor( Qt::IBeamCursor );
Animated icon is keeping an animation running if there are listeners connected to frameChanged.
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
void focusInEvent(QFocusEvent *e) override
void selectOnFocusChanged()
Will select all text when this widget receives the focus.
void showSpinnerChanged()
Show a spinner icon.
ClearMode clearMode() const
Returns the clear mode for the widget.
bool showClearButton() const
Returns true if the widget's clear button is visible.
virtual void clearValue()
Clears the widget and resets it to the null value.
bool showSearchIcon() const
Returns if a search icon shall be shown on the left of the image when no text is entered.
ClearMode
Behavior when clearing value of widget.
@ ClearToNull
Reset value to null.
@ ClearToDefault
Reset value to default value (see defaultValue() ).
bool isNull() const
Determine if the current text represents null.
QString nullValue() const
Returns the string used for representing null values in the widget.
void setValue(const QString &value)
Sets the current text for the widget with support for handling null values.
void setShowSearchIcon(bool visible)
Define if a search icon shall be shown on the left of the image when no text is entered.
void setShowClearButton(bool visible)
Sets whether the widget's clear button is visible.
friend class TestQgsFeatureListComboBox
QgsFilterLineEdit(QWidget *parent=nullptr, const QString &nullValue=QString())
Constructor for QgsFilterLineEdit.
bool hasStateStored() const
Returns if a state is already saved.
void mouseReleaseEvent(QMouseEvent *e) override
QString defaultValue() const
Returns the default value for the widget.
void setNullValue(const QString &nullValue)
Sets the string representation for null values in the widget.
void cleared()
Emitted when the widget is cleared.
void setDefaultValue(const QString &defaultValue)
Sets the default value for the widget.
QString value() const
Returns the text of this edit with support for handling null values.
void setShowSpinner(bool showSpinner)
Show a spinner icon.
void setClearMode(ClearMode mode)
Sets the clear mode for the widget.
void valueChanged(const QString &value)
Same as textChanged() but with support for null values.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)