aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents_p_p.h
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@theqtcompany.com>2016-05-24 10:23:02 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-05-25 11:31:38 +0000
commitb88e0091de65950a3e7c5ace6d8e6ca2b486a07d (patch)
tree74dd5e905fba1229ef1139230f7bde69ef3e09e6 /src/quick/items/qquickevents_p_p.h
parent5f3b1e81257ca94904720d0365454002756e12bc (diff)
Add QQuickWheelEvent::inverted()
When handling wheel events, it's useful to know whether or not "natural" scrolling was enabled on platforms like OSX where the scrolling direction can be reversed. It's especially useful when implementing components like Slider (see QTBUG-35972). This will soon be needed in QtQuick.Controls because we plan to remove the WheelArea. Change-Id: I2770e0aa39e7e54511d7f9f7cc12760580a55e5c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents_p_p.h')
-rw-r--r--src/quick/items/qquickevents_p_p.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h
index b28ab555b0..3eafce4d7e 100644
--- a/src/quick/items/qquickevents_p_p.h
+++ b/src/quick/items/qquickevents_p_p.h
@@ -153,13 +153,14 @@ class QQuickWheelEvent : public QObject
Q_PROPERTY(QPoint pixelDelta READ pixelDelta)
Q_PROPERTY(int buttons READ buttons)
Q_PROPERTY(int modifiers READ modifiers)
+ Q_PROPERTY(bool inverted READ inverted)
Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
public:
QQuickWheelEvent(qreal x, qreal y, const QPoint& angleDelta, const QPoint& pixelDelta,
- Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
+ Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, bool inverted)
: _x(x), _y(y), _angleDelta(angleDelta), _pixelDelta(pixelDelta), _buttons(buttons),
- _modifiers(modifiers), _accepted(true) {}
+ _modifiers(modifiers), _inverted(inverted), _accepted(true) {}
qreal x() const { return _x; }
qreal y() const { return _y; }
@@ -167,7 +168,7 @@ public:
QPoint pixelDelta() const { return _pixelDelta; }
int buttons() const { return _buttons; }
int modifiers() const { return _modifiers; }
-
+ bool inverted() const { return _inverted; }
bool isAccepted() { return _accepted; }
void setAccepted(bool accepted) { _accepted = accepted; }
@@ -178,6 +179,7 @@ private:
QPoint _pixelDelta;
Qt::MouseButtons _buttons;
Qt::KeyboardModifiers _modifiers;
+ bool _inverted;
bool _accepted;
};