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>
bb10
Frederik Gladhorn 2018-08-02 07:41:03 +02:00 committed by Shawn Rutledge
parent 1ae3db46e8
commit 4fdda5a584
1 changed files with 6 additions and 4 deletions

View File

@ -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)