diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-01-07 12:54:03 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@theqtcompany.com> | 2016-03-06 19:39:42 +0000 |
commit | bcd88d8e9984bff664740aae3cff708a069dbbdd (patch) | |
tree | 135211722f685ebd1fca8c74a450a0109c23e60d /src/gui/kernel/qevent.h | |
parent | d4b6ed3c18ecad9de1da182e6c1e3fc4eced2e49 (diff) |
Add QWheelEvent::inverted()
Some consumers of wheel events need to know if the
scrolling direction is inverted in order to provide
consistent behavior.
For example, the scrolling direction of a horizontal
slider should not change when the user toggles the
"natural scrolling" setting on OS X. In this case
the inverted bit will change state and the slider
can compensate.
This change adds a bit to QWheelEvent and sets it
on OS X.
Task-number: QTBUG-35972
Change-Id: I221435dea45d436d570b113bd0e24ee6f6832211
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 5752869cab..0a207667ad 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -187,6 +187,9 @@ public: QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source); + QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, + int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons, + Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source, bool inverted); ~QWheelEvent(); @@ -210,6 +213,7 @@ public: inline Qt::MouseButtons buttons() const { return mouseState; } inline Qt::ScrollPhase phase() const { return Qt::ScrollPhase(ph); } + inline bool inverted() const { return invertedScrolling; } Qt::MouseEventSource source() const { return Qt::MouseEventSource(src); } @@ -223,7 +227,8 @@ protected: Qt::MouseButtons mouseState; uint ph : 2; uint src: 2; - int reserved : 28; + bool invertedScrolling : 1; + int reserved : 27; friend class QApplication; }; |