23 class QgsSpinBoxLineEdit;
47 if ( qobject_cast<QgsSpinBox *>( sipCpp ) )
48 sipType = sipType_QgsSpinBox;
55 Q_PROPERTY(
bool showClearButton READ showClearButton WRITE setShowClearButton )
56 Q_PROPERTY(
bool clearValue READ clearValue WRITE setClearValue )
57 Q_PROPERTY(
bool expressionsEnabled READ expressionsEnabled WRITE setExpressionsEnabled )
81 void setShowClearButton(
bool showClearButton );
95 void setExpressionsEnabled(
bool enabled );
106 void clear()
override;
114 void setClearValue(
int customValue,
const QString &clearValueText = QString() );
121 void setClearValueMode( ClearValueMode mode,
const QString &clearValueText = QString() );
127 int clearValue()
const;
133 void setLineEditAlignment( Qt::Alignment alignment );
140 void setSpecialValueText(
const QString &txt );
142 int valueFromText(
const QString &text )
const override;
143 QValidator::State validate( QString &input,
int &pos )
const override;
147 void changeEvent( QEvent *event )
override;
148 void paintEvent( QPaintEvent *event )
override;
149 void wheelEvent( QWheelEvent *event )
override;
153 void timerEvent( QTimerEvent *event )
override;
156 void changed(
int value );
159 int frameWidth()
const;
160 bool shouldShowClearForValue(
int value )
const;
162 QgsSpinBoxLineEdit *mLineEdit =
nullptr;
164 bool mShowClearButton =
true;
165 ClearValueMode mClearValueMode = MinimumValue;
166 int mCustomClearValue = 0;
168 bool mExpressionsEnabled =
true;
170 QString stripped(
const QString &originalText )
const;
172 friend class TestQgsRangeWidgetWrapper;
176 #endif // QGSSPINBOX_H