From e40f23f098a1e79c22df611b6312317582b95a3a Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Fri, 18 May 2018 16:27:43 +0100 Subject: Add QStyle::SH_SpinBox_StepModifier style hint This patch allows the developer to pick which keyboard modifier increases the number of steps a QAbstractSpinBox takes when the user interacts with it. The modifier can be either Qt::ControlModifier (default), Qt::ShiftModifier or Qt::NoModifier. Qt::NoModifier disables the step modifier. Note that on macOS, Control corresponds to the Command key. Holding the modifier increases the step rate when: - scrolling; - pressing the up/down keys; - pressing the spin box up/down buttons. [ChangeLog][QtWidgets][QStyle] QStyle::SH_SpinBox_StepModifier allows the developer to pick which keyboard modifier increases the number of steps a QAbstractSpinBox takes for the following interactions: scrolling, up/down keyboard keys and the spin box buttons. The Qt::ShiftModifier can now be used, or the feature can be disabled using Qt::NoModifier. Previously, only Qt::ControlModifier could be used as the modifier. Change-Id: Ib5518127e86a8f67798a9a1d6e860c6e35896e6f Reviewed-by: Richard Moe Gustavsen --- src/widgets/styles/qstyle.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/widgets/styles/qstyle.cpp') diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 73a6554f1a..8006be8c27 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -2001,6 +2001,13 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, Determnines if the spin box buttons are inside the line edit frame. This enum value has been introduced in Qt 5.11. + \value SH_SpinBox_StepModifier + Determines which Qt::KeyboardModifier increases the step rate of + QAbstractSpinBox. Possible values are Qt::NoModifier, + Qt::ControlModifier (default) or Qt::ShiftModifier. Qt::NoModifier + disables this feature. + This enum value has been introduced in Qt 5.12. + \sa styleHint() */ -- cgit v1.2.3