diff options
Diffstat (limited to 'src/widgets/widgets/qabstractspinbox.cpp')
-rw-r--r-- | src/widgets/widgets/qabstractspinbox.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 0459eadfff..822d896ee6 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -106,6 +106,10 @@ QT_BEGIN_NAMESPACE the spinbox buttons. Note that on macOS, Control corresponds to the Command key. + Since Qt 5.12, QStyle::SH_SpinBox_StepModifier can be used to select + which Qt::KeyboardModifier increases the step rate. Qt::NoModifier + disables this feature. + QAbstractSpinBox also provide a virtual function stepEnabled() to determine whether stepping up/down is allowed at any point. This function returns a bitset of StepEnabled. @@ -840,6 +844,7 @@ void QAbstractSpinBox::changeEvent(QEvent *event) style()->styleHint(QStyle::SH_SpinBox_ClickAutoRepeatThreshold, 0, this); if (d->edit) d->edit->setFrame(!style()->styleHint(QStyle::SH_SpinBox_ButtonsInsideFrame, nullptr, this)); + d->stepModifier = static_cast<Qt::KeyboardModifier>(style()->styleHint(QStyle::SH_SpinBox_StepModifier, nullptr, this)); d->reset(); d->updateEditFieldGeometry(); break; |