Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
Allows the user to select from a set of preset values. More...
Allows the user to select from a set of preset values.
\qmltype SpinBox \inherits Control
! \instantiates QQuickSpinBox \inqmlmodule QtQuick.Controls
SpinBox allows the user to choose an integer value by clicking the up or down indicator buttons, or by pressing up or down on the keyboard. Optionally, SpinBox can be also made \l editable, so the user can enter a text value in the input field.
By default, SpinBox provides discrete values in the range of [0-99] with a \l stepSize of
1
.
Definition at line 78 of file qquickspinbox.cpp.
int QQuickSpinBoxPrivate::boundValue | ( | int | value, |
bool | wrap ) const |
Definition at line 140 of file qquickspinbox.cpp.
References from, qBound(), to, value, and wrap.
Referenced by contentItemTextChanged(), and setValue().
void QQuickSpinBoxPrivate::contentItemTextChanged | ( | ) |
Definition at line 233 of file qquickspinbox.cpp.
References boundValue(), evaluateValueFromText(), live, setDisplayText(), and text.
Referenced by QQuickSpinBox::contentItemChange().
void QQuickSpinBoxPrivate::decrease | ( | bool | modified | ) |
Definition at line 207 of file qquickspinbox.cpp.
References effectiveStepSize(), setValue(), and wrap.
|
inlineoverridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 118 of file qquickspinbox.cpp.
References QQuickTheme::palette(), and QQuickTheme::SpinBox.
bool QQuickSpinBoxPrivate::downEnabled | ( | ) | const |
Definition at line 275 of file qquickspinbox.cpp.
References down, QQuickIndicatorButton::indicator, and QQuickItem::isEnabled().
int QQuickSpinBoxPrivate::effectiveStepSize | ( | ) | const |
Definition at line 212 of file qquickspinbox.cpp.
References from, stepSize, and to.
Referenced by decrease(), and increase().
QString QQuickSpinBoxPrivate::evaluateTextFromValue | ( | int | val | ) | const |
Definition at line 426 of file qquickspinbox.cpp.
References QJSValue::call(), engine, QV4::ExecutionEngine::fromData(), QJSValuePrivate::fromReturnedValue(), QQmlEnginePrivate::getV4Engine(), QJSValue::isCallable(), QQuickControlPrivate::locale, qmlEngine(), text, textFromValue, QJSValue::toString(), and QLocale::toString().
Referenced by updateDisplayText().
int QQuickSpinBoxPrivate::evaluateValueFromText | ( | const QString & | text | ) | const |
Definition at line 446 of file qquickspinbox.cpp.
References QJSValue::call(), engine, QV4::ExecutionEngine::fromData(), QJSValuePrivate::fromReturnedValue(), QQmlEnginePrivate::getV4Engine(), QJSValue::isCallable(), QQuickControlPrivate::locale, qmlEngine(), text, QJSValue::toInt(), QLocale::toInt(), value, and valueFromText.
Referenced by contentItemTextChanged(), and updateValue().
Reimplemented from QQuickControlPrivate.
Definition at line 342 of file qquickspinbox.cpp.
References down, QQuickControlPrivate::handleMove(), QQuickIndicatorButton::indicator, QQuickIndicatorButton::isHovered(), QQuickIndicatorButton::isPressed(), QQuickIndicatorButton::setHovered(), QQuickIndicatorButton::setPressed(), stopPressRepeat(), and up.
Reimplemented from QQuickControlPrivate.
Definition at line 326 of file qquickspinbox.cpp.
References down, QQuickControlPrivate::handlePress(), QQuickIndicatorButton::indicator, QQuickIndicatorButton::isPressed(), QQuickIndicatorButton::setPressed(), startRepeatDelay(), and up.
Reimplemented from QQuickControlPrivate.
Definition at line 360 of file qquickspinbox.cpp.
References contains(), down, emit, QQuickControlPrivate::handleRelease(), QQuickIndicatorButton::indicator, QQuickIndicatorButton::isPressed(), QQuickIndicatorButton::setPressed(), stopPressRepeat(), up, and value.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 387 of file qquickspinbox.cpp.
References down, QQuickControlPrivate::handleUngrab(), QQuickIndicatorButton::setPressed(), stopPressRepeat(), and up.
void QQuickSpinBoxPrivate::increase | ( | bool | modified | ) |
Definition at line 202 of file qquickspinbox.cpp.
References effectiveStepSize(), setValue(), and wrap.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 416 of file qquickspinbox.cpp.
References down, QQuickIndicatorButton::indicator, item, QQuickControlPrivate::itemDestroyed(), QQuickIndicatorButton::setIndicator(), and up.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 407 of file qquickspinbox.cpp.
References down, emit, QQuickIndicatorButton::indicator, item, QQuickControlPrivate::itemImplicitHeightChanged(), and up.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 398 of file qquickspinbox.cpp.
References down, emit, QQuickIndicatorButton::indicator, item, QQuickControlPrivate::itemImplicitWidthChanged(), and up.
Definition at line 222 of file qquickspinbox.cpp.
References displayText, emit, and text.
Referenced by contentItemTextChanged(), and updateDisplayText().
bool QQuickSpinBoxPrivate::setValue | ( | int | value, |
bool | wrap, | ||
bool | modified ) |
Definition at line 170 of file qquickspinbox.cpp.
References boundValue(), emit, updateDisplayText(), updateDownEnabled(), and updateUpEnabled().
Referenced by decrease(), increase(), stepBy(), and updateValue().
void QQuickSpinBoxPrivate::startPressRepeat | ( | ) |
Definition at line 306 of file qquickspinbox.cpp.
References AUTO_REPEAT_INTERVAL, repeatTimer, and stopPressRepeat().
void QQuickSpinBoxPrivate::startRepeatDelay | ( | ) |
Definition at line 299 of file qquickspinbox.cpp.
References AUTO_REPEAT_DELAY, delayTimer, and stopPressRepeat().
Referenced by handlePress().
bool QQuickSpinBoxPrivate::stepBy | ( | int | steps, |
bool | modified ) |
Definition at line 197 of file qquickspinbox.cpp.
References setValue(), and wrap.
void QQuickSpinBoxPrivate::stopPressRepeat | ( | ) |
Definition at line 313 of file qquickspinbox.cpp.
References delayTimer, and repeatTimer.
Referenced by handleMove(), handleRelease(), handleUngrab(), startPressRepeat(), and startRepeatDelay().
void QQuickSpinBoxPrivate::updateDisplayText | ( | ) |
Definition at line 217 of file qquickspinbox.cpp.
References evaluateTextFromValue(), and setDisplayText().
Referenced by setValue().
void QQuickSpinBoxPrivate::updateDownEnabled | ( | ) |
Definition at line 281 of file qquickspinbox.cpp.
References down, from, QQuickIndicatorButton::indicator, QQuickItem::setEnabled(), and wrap.
Referenced by setValue().
Definition at line 290 of file qquickspinbox.cpp.
References down, QQuickIndicatorButton::indicator, pos, QQuickIndicatorButton::setHovered(), and up.
void QQuickSpinBoxPrivate::updateUpEnabled | ( | ) |
Definition at line 266 of file qquickspinbox.cpp.
References from, QQuickIndicatorButton::indicator, QQuickItem::setEnabled(), to, up, and wrap.
Referenced by setValue().
void QQuickSpinBoxPrivate::updateValue | ( | ) |
Definition at line 156 of file qquickspinbox.cpp.
References QQuickControlPrivate::contentItem, evaluateValueFromText(), QObject::property(), setValue(), and text.
bool QQuickSpinBoxPrivate::upEnabled | ( | ) | const |
Definition at line 260 of file qquickspinbox.cpp.
References QQuickIndicatorButton::indicator, QQuickItem::isEnabled(), and up.
int QQuickSpinBoxPrivate::delayTimer = 0 |
Definition at line 127 of file qquickspinbox.cpp.
Referenced by startRepeatDelay(), and stopPressRepeat().
QString QQuickSpinBoxPrivate::displayText |
Definition at line 129 of file qquickspinbox.cpp.
Referenced by setDisplayText().
QQuickIndicatorButton* QQuickSpinBoxPrivate::down = nullptr |
Definition at line 131 of file qquickspinbox.cpp.
Referenced by downEnabled(), handleMove(), handlePress(), handleRelease(), handleUngrab(), itemDestroyed(), itemImplicitHeightChanged(), itemImplicitWidthChanged(), updateDownEnabled(), and updateHover().
bool QQuickSpinBoxPrivate::editable = false |
Definition at line 120 of file qquickspinbox.cpp.
int QQuickSpinBoxPrivate::from = 0 |
Definition at line 123 of file qquickspinbox.cpp.
Referenced by boundValue(), effectiveStepSize(), updateDownEnabled(), and updateUpEnabled().
Qt::InputMethodHints QQuickSpinBoxPrivate::inputMethodHints = Qt::ImhDigitsOnly |
Definition at line 137 of file qquickspinbox.cpp.
bool QQuickSpinBoxPrivate::live = false |
Definition at line 121 of file qquickspinbox.cpp.
Referenced by contentItemTextChanged().
int QQuickSpinBoxPrivate::repeatTimer = 0 |
Definition at line 128 of file qquickspinbox.cpp.
Referenced by startPressRepeat(), and stopPressRepeat().
int QQuickSpinBoxPrivate::stepSize = 1 |
Definition at line 126 of file qquickspinbox.cpp.
Referenced by effectiveStepSize().
|
mutable |
Definition at line 135 of file qquickspinbox.cpp.
Referenced by evaluateTextFromValue().
int QQuickSpinBoxPrivate::to = 99 |
Definition at line 124 of file qquickspinbox.cpp.
Referenced by boundValue(), effectiveStepSize(), and updateUpEnabled().
QQuickIndicatorButton* QQuickSpinBoxPrivate::up = nullptr |
Definition at line 130 of file qquickspinbox.cpp.
Referenced by handleMove(), handlePress(), handleRelease(), handleUngrab(), itemDestroyed(), itemImplicitHeightChanged(), itemImplicitWidthChanged(), updateHover(), updateUpEnabled(), and upEnabled().
int QQuickSpinBoxPrivate::value = 0 |
Definition at line 125 of file qquickspinbox.cpp.
Referenced by boundValue(), evaluateValueFromText(), and handleRelease().
|
mutable |
Definition at line 136 of file qquickspinbox.cpp.
Referenced by evaluateValueFromText().
bool QQuickSpinBoxPrivate::wrap = false |
Definition at line 122 of file qquickspinbox.cpp.
Referenced by boundValue(), decrease(), increase(), stepBy(), updateDownEnabled(), and updateUpEnabled().