20 #include <QToolButton>
30 Q_PROPERTY(
bool showClearButton READ showClearButton WRITE setShowClearButton )
44 void setShowClearButton(
const bool showClearButton );
52 void setExpressionsEnabled(
const bool enabled );
61 virtual void clear()
override;
68 void setClearValue(
int customValue, QString clearValueText = QString() );
74 void setClearValueMode( ClearValueMode mode, QString clearValueText = QString() );
77 int clearValue()
const;
79 virtual int valueFromText(
const QString & text )
const override;
80 virtual QValidator::State validate( QString & input,
int & pos )
const override;
83 virtual void resizeEvent( QResizeEvent* event )
override;
84 virtual void changeEvent( QEvent* event )
override;
85 virtual void paintEvent( QPaintEvent* event )
override;
88 void changed(
const int& value );
91 int frameWidth()
const;
92 bool shouldShowClearForValue(
const int value )
const;
94 bool mShowClearButton;
95 ClearValueMode mClearValueMode;
96 int mCustomClearValue;
98 bool mExpressionsEnabled;
100 QToolButton* mClearButton;
101 QString stripped(
const QString &originalText )
const;
104 #endif // QGSSPPINBOX_H