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 );
223 bool event( QEvent *event )
override;
238 virtual void clearValue();
265 void valueChanged(
const QString &value );
273 void showSpinnerChanged();
281 void selectOnFocusChanged();
284 void focusInEvent( QFocusEvent *e )
override;
285 void mouseReleaseEvent( QMouseEvent *e )
override;
288 void onTextChanged(
const QString &text );
289 void updateBusySpinner();
290 void updateClearIcon();
295 bool hasStateStored =
false;
303 QAction *mClearAction =
nullptr;
304 QAction *mSearchAction =
nullptr;
305 QAction *mBusySpinnerAction =
nullptr;
307 bool mClearButtonVisible =
true;
308 bool mShowSpinner =
false;
310 ClearMode mClearMode = ClearToNull;
313 QString mDefaultValue;
315 bool mWaitingForMouseRelease =
false;
316 bool mSelectOnFocus =
false;
318 LineEditState mLineEditState;
323 bool shouldShowClear()
const;
325 friend class TestQgsFeatureListComboBox;
342 QgsSpinBoxLineEdit( QWidget *parent =
nullptr )
351 setCursor( Qt::IBeamCursor );
361 #endif // QGSFILTERLINEEDIT_H