summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2018-08-02 07:41:03 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-08-14 20:06:55 +0000
commit4fdda5a584f7ecf68a0a9ac4006c2abd730b918c (patch)
tree572c5c7954cf5a2ef6204675f7a4bde477d65a22 /src/gui
parent1ae3db46e8e98b6c3ce07a5b35330bc75dd86bfc (diff)
Fix delta in QWheelEvent passed to QQuickItem
While the property is deprecated, we should still set it, even in the legacy free constructor. The window system never sends x and y changes at the same time, so either coordinate will be null, therefor add them. This should restore the old behavior. Task-number: QTBUG-69089 Change-Id: Ie329cb4196f53c70b25934cbbac5e2e48c65d2b3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qevent.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 2362b93bf0..2a81cdf385 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -995,10 +995,12 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QWheelEvent::QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
bool inverted, Qt::MouseEventSource source)
- : QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta),
- angleD(angleDelta), mouseState(buttons), ph(phase), src(source),
- invertedScrolling(inverted)
-{}
+ : QInputEvent(Wheel, modifiers), p(pos), g(globalPos), pixelD(pixelDelta), angleD(angleDelta),
+ qt4O(qAbs(angleDelta.x()) > qAbs(angleDelta.y()) ? Qt::Horizontal : Qt::Vertical),
+ mouseState(buttons), ph(phase), src(source), invertedScrolling(inverted)
+{
+ qt4D = (qt4O == Qt::Horizontal ? angleDelta.x() : angleDelta.y());
+}
#endif // QT_CONFIG(wheelevent)