diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-01-05 09:24:08 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-01-05 09:34:14 +0000 |
commit | 314a05debe668cf0a17991121401e93fb846adf6 (patch) | |
tree | 973227ac0b0f6a39c373f7b68506b6cad534c24f /src/quicktemplates2 | |
parent | 9e49e6039574898f73523cbcd8f6080ec6ad31e3 (diff) |
QQuickDial: account for when the wheel event is inverted
On macOS, the vertical scrolling with the wheel may be inverted, so we
need to account for this when getting the y angle.
Change-Id: Ia0f59beba905beff7b0cf12271a654c721bd5179
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickdial.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp index 2b9f83a4..04f4eda5 100644 --- a/src/quicktemplates2/qquickdial.cpp +++ b/src/quicktemplates2/qquickdial.cpp @@ -613,7 +613,7 @@ void QQuickDial::wheelEvent(QWheelEvent *event) if (d->wheelEnabled) { const qreal oldValue = d->value; const QPointF angle = event->angleDelta(); - const qreal delta = (qFuzzyIsNull(angle.y()) ? angle.x() : angle.y()) / QWheelEvent::DefaultDeltasPerStep; + const qreal delta = (qFuzzyIsNull(angle.y()) ? angle.x() : (event->inverted() ? -angle.y() : angle.y())) / QWheelEvent::DefaultDeltasPerStep; const qreal step = qFuzzyIsNull(d->stepSize) ? 0.1 : d->stepSize; setValue(oldValue + step * delta); event->setAccepted(!qFuzzyCompare(d->value, oldValue)); |