24class QgsSpinBoxLineEdit;
48 if ( qobject_cast<QgsSpinBox *>( sipCpp ) )
49 sipType = sipType_QgsSpinBox;
81 void setShowClearButton(
bool showClearButton );
94 void setExpressionsEnabled(
bool enabled );
104 void clear()
override;
112 void setClearValue(
int customValue,
const QString &clearValueText = QString() );
119 void setClearValueMode( ClearValueMode mode,
const QString &clearValueText = QString() );
125 int clearValue()
const;
131 void setLineEditAlignment( Qt::Alignment alignment );
138 void setSpecialValueText(
const QString &txt );
140 int valueFromText(
const QString &text )
const override;
141 QValidator::State validate( QString &input,
int &pos )
const override;
142 void stepBy(
int steps )
override;
152 int editingTimeoutInterval()
const;
165 void setEditingTimeoutInterval(
int timeout );
198 void paintEvent( QPaintEvent *event )
override;
199 void wheelEvent( QWheelEvent *event )
override;
203 void timerEvent( QTimerEvent *event )
override;
207 void changed(
int value );
208 void onLastEditTimeout();
211 int frameWidth()
const;
212 bool shouldShowClearForValue(
int value )
const;
214 QgsSpinBoxLineEdit *mLineEdit =
nullptr;
216 bool mShowClearButton =
true;
218 int mCustomClearValue = 0;
220 bool mExpressionsEnabled =
true;
222 QTimer *mLastEditTimer =
nullptr;
223 bool mHasEmittedEditTimeout =
false;
224 int mLastEditTimeoutValue = 0;
226 QString stripped(
const QString &originalText )
const;
A spin box with a clear button that will set the value to the defined clear value.
void returnPressed()
Emitted when the Return or Enter key is used in the line edit.
ClearValueMode
Behavior when widget is cleared.
@ MaximumValue
Reset value to maximum().
@ MinimumValue
Reset value to minimum().
@ CustomValue
Reset value to custom value (see setClearValue() ).
bool showClearButton() const
Returns whether the widget is showing a clear button.
void wheelEvent(QWheelEvent *event) override
void editingTimeout(int value)
Emitted when either:
void setShowClearButton(bool showClearButton)
Sets whether the widget will show a clear button.
void focusOutEvent(QFocusEvent *event) override
QgsSpinBox(QWidget *parent=nullptr)
Constructor for QgsSpinBox.
bool expressionsEnabled() const
Returns whether the widget will allow entry of simple expressions, which are evaluated and then disca...
void textEdited(const QString &text)
Emitted when the the value has been manually edited via line edit.
void paintEvent(QPaintEvent *event) override
friend class TestQgsRangeWidgetWrapper
void timerEvent(QTimerEvent *event) override
void setClearValue(int customValue, const QString &clearValueText=QString())
Defines the clear value as a custom value and will automatically set the clear value mode to CustomVa...
void setExpressionsEnabled(bool enabled)
Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.
void changeEvent(QEvent *event) override
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)