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 );
135 int valueFromText(
const QString &text )
const override;
136 QValidator::State validate( QString &input,
int &pos )
const override;
140 void changeEvent( QEvent *event )
override;
141 void paintEvent( QPaintEvent *event )
override;
142 void wheelEvent( QWheelEvent *event )
override;
145 void changed(
int value );
148 int frameWidth()
const;
149 bool shouldShowClearForValue(
int value )
const;
151 QgsSpinBoxLineEdit *mLineEdit =
nullptr;
153 bool mShowClearButton =
true;
155 int mCustomClearValue = 0;
157 bool mExpressionsEnabled =
true;
159 QString stripped(
const QString &originalText )
const;
162 #endif // QGSSPINBOX_H
ClearValueMode
Behavior when widget is cleared.
Reset value to custom value (see setClearValue() )
bool showClearButton() const
Returns whether the widget is showing a clear button.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value...
bool expressionsEnabled() const
Returns whether the widget will allow entry of simple expressions, which are evaluated and then disca...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)