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 83 of file qquickspinbox.cpp.
int QQuickSpinBoxPrivate::boundValue | ( | int | value, |
bool | wrap ) const |
Definition at line 145 of file qquickspinbox.cpp.
References from, qBound(), to, value, and wrap.
Referenced by contentItemTextChanged(), and setValue().
void QQuickSpinBoxPrivate::contentItemTextChanged | ( | ) |
Definition at line 238 of file qquickspinbox.cpp.
References boundValue(), evaluateValueFromText(), live, setDisplayText(), and text.
Referenced by QQuickSpinBox::contentItemChange().
void QQuickSpinBoxPrivate::decrease | ( | bool | modified | ) |
Definition at line 212 of file qquickspinbox.cpp.
References effectiveStepSize(), setValue(), and wrap.
|
inlineoverridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 123 of file qquickspinbox.cpp.
References QQuickTheme::palette(), and QQuickTheme::SpinBox.
bool QQuickSpinBoxPrivate::downEnabled | ( | ) | const |
Definition at line 280 of file qquickspinbox.cpp.
References down, QQuickIndicatorButton::indicator, and QQuickItem::isEnabled().
int QQuickSpinBoxPrivate::effectiveStepSize | ( | ) | const |
Definition at line 217 of file qquickspinbox.cpp.
References from, stepSize, and to.
Referenced by decrease(), and increase().
QString QQuickSpinBoxPrivate::evaluateTextFromValue | ( | int | val | ) | const |
Definition at line 431 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 451 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 347 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 331 of file qquickspinbox.cpp.
References down, QQuickControlPrivate::handlePress(), QQuickIndicatorButton::indicator, QQuickIndicatorButton::isPressed(), QQuickIndicatorButton::setPressed(), startRepeatDelay(), and up.
Reimplemented from QQuickControlPrivate.
Definition at line 365 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 392 of file qquickspinbox.cpp.
References down, QQuickControlPrivate::handleUngrab(), QQuickIndicatorButton::setPressed(), stopPressRepeat(), and up.
void QQuickSpinBoxPrivate::increase | ( | bool | modified | ) |
Definition at line 207 of file qquickspinbox.cpp.
References effectiveStepSize(), setValue(), and wrap.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 421 of file qquickspinbox.cpp.
References down, QQuickIndicatorButton::indicator, item, QQuickControlPrivate::itemDestroyed(), QQuickIndicatorButton::setIndicator(), and up.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 412 of file qquickspinbox.cpp.
References down, emit, QQuickIndicatorButton::indicator, item, QQuickControlPrivate::itemImplicitHeightChanged(), and up.
|
overridevirtual |
Reimplemented from QQuickControlPrivate.
Definition at line 403 of file qquickspinbox.cpp.
References down, emit, QQuickIndicatorButton::indicator, item, QQuickControlPrivate::itemImplicitWidthChanged(), and up.
Definition at line 227 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 175 of file qquickspinbox.cpp.
References boundValue(), emit, updateDisplayText(), updateDownEnabled(), and updateUpEnabled().
Referenced by decrease(), increase(), stepBy(), and updateValue().
void QQuickSpinBoxPrivate::startPressRepeat | ( | ) |
Definition at line 311 of file qquickspinbox.cpp.
References AUTO_REPEAT_INTERVAL, repeatTimer, and stopPressRepeat().
void QQuickSpinBoxPrivate::startRepeatDelay | ( | ) |
Definition at line 304 of file qquickspinbox.cpp.
References AUTO_REPEAT_DELAY, delayTimer, and stopPressRepeat().
Referenced by handlePress().
bool QQuickSpinBoxPrivate::stepBy | ( | int | steps, |
bool | modified ) |
Definition at line 202 of file qquickspinbox.cpp.
References setValue(), and wrap.
void QQuickSpinBoxPrivate::stopPressRepeat | ( | ) |
Definition at line 318 of file qquickspinbox.cpp.
References delayTimer, and repeatTimer.
Referenced by handleMove(), handleRelease(), handleUngrab(), startPressRepeat(), and startRepeatDelay().
void QQuickSpinBoxPrivate::updateDisplayText | ( | ) |
Definition at line 222 of file qquickspinbox.cpp.
References evaluateTextFromValue(), and setDisplayText().
Referenced by setValue().
void QQuickSpinBoxPrivate::updateDownEnabled | ( | ) |
Definition at line 286 of file qquickspinbox.cpp.
References down, from, QQuickIndicatorButton::indicator, QQuickItem::setEnabled(), and wrap.
Referenced by setValue().
Definition at line 295 of file qquickspinbox.cpp.
References down, QQuickIndicatorButton::indicator, pos, QQuickIndicatorButton::setHovered(), and up.
void QQuickSpinBoxPrivate::updateUpEnabled | ( | ) |
Definition at line 271 of file qquickspinbox.cpp.
References from, QQuickIndicatorButton::indicator, QQuickItem::setEnabled(), to, up, and wrap.
Referenced by setValue().
void QQuickSpinBoxPrivate::updateValue | ( | ) |
Definition at line 161 of file qquickspinbox.cpp.
References QQuickControlPrivate::contentItem, evaluateValueFromText(), QObject::property(), setValue(), and text.
bool QQuickSpinBoxPrivate::upEnabled | ( | ) | const |
Definition at line 265 of file qquickspinbox.cpp.
References QQuickIndicatorButton::indicator, QQuickItem::isEnabled(), and up.
int QQuickSpinBoxPrivate::delayTimer = 0 |
Definition at line 132 of file qquickspinbox.cpp.
Referenced by startRepeatDelay(), and stopPressRepeat().
QString QQuickSpinBoxPrivate::displayText |
Definition at line 134 of file qquickspinbox.cpp.
Referenced by setDisplayText().
QQuickIndicatorButton* QQuickSpinBoxPrivate::down = nullptr |
Definition at line 136 of file qquickspinbox.cpp.
Referenced by downEnabled(), handleMove(), handlePress(), handleRelease(), handleUngrab(), itemDestroyed(), itemImplicitHeightChanged(), itemImplicitWidthChanged(), updateDownEnabled(), and updateHover().
bool QQuickSpinBoxPrivate::editable = false |
Definition at line 125 of file qquickspinbox.cpp.
int QQuickSpinBoxPrivate::from = 0 |
Definition at line 128 of file qquickspinbox.cpp.
Referenced by boundValue(), effectiveStepSize(), updateDownEnabled(), and updateUpEnabled().
Qt::InputMethodHints QQuickSpinBoxPrivate::inputMethodHints = Qt::ImhDigitsOnly |
Definition at line 142 of file qquickspinbox.cpp.
bool QQuickSpinBoxPrivate::live = false |
Definition at line 126 of file qquickspinbox.cpp.
Referenced by contentItemTextChanged().
int QQuickSpinBoxPrivate::repeatTimer = 0 |
Definition at line 133 of file qquickspinbox.cpp.
Referenced by startPressRepeat(), and stopPressRepeat().
int QQuickSpinBoxPrivate::stepSize = 1 |
Definition at line 131 of file qquickspinbox.cpp.
Referenced by effectiveStepSize().
|
mutable |
Definition at line 140 of file qquickspinbox.cpp.
Referenced by evaluateTextFromValue().
int QQuickSpinBoxPrivate::to = 99 |
Definition at line 129 of file qquickspinbox.cpp.
Referenced by boundValue(), effectiveStepSize(), and updateUpEnabled().
QQuickIndicatorButton* QQuickSpinBoxPrivate::up = nullptr |
Definition at line 135 of file qquickspinbox.cpp.
Referenced by handleMove(), handlePress(), handleRelease(), handleUngrab(), itemDestroyed(), itemImplicitHeightChanged(), itemImplicitWidthChanged(), updateHover(), updateUpEnabled(), and upEnabled().
int QQuickSpinBoxPrivate::value = 0 |
Definition at line 130 of file qquickspinbox.cpp.
Referenced by boundValue(), evaluateValueFromText(), and handleRelease().
|
mutable |
Definition at line 141 of file qquickspinbox.cpp.
Referenced by evaluateValueFromText().
bool QQuickSpinBoxPrivate::wrap = false |
Definition at line 127 of file qquickspinbox.cpp.
Referenced by boundValue(), decrease(), increase(), stepBy(), updateDownEnabled(), and updateUpEnabled().