diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-12-12 15:50:36 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-01-18 06:52:14 +0000 |
commit | 0e8546f6b8faf5fb14fc249d9f39f1c4266b2965 (patch) | |
tree | ba2f4d6e4cf5797bd18d1ccd7095cebe3aee4a18 /src/quick/items/qquickevents_p_p.h | |
parent | 72c913085d7ce83733475864448e906c2894b6c1 (diff) |
Add support for getting the flags from the original mouse event
Change-Id: Ifdf0b8cb43b1e88f3931f49ac6ca72019548ddcf
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.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index af5857cf63..0f7e44e0e2 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -131,15 +131,18 @@ class Q_QUICK_PRIVATE_EXPORT QQuickMouseEvent : public QObject Q_PROPERTY(bool wasHeld READ wasHeld) Q_PROPERTY(bool isClick READ isClick) Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + Q_REVISION(11) Q_PROPERTY(int flags READ flags) public: QQuickMouseEvent() : _x(0), _y(0), _button(Qt::NoButton), _buttons(Qt::NoButton), _modifiers(Qt::NoModifier) , _source(Qt::MouseEventNotSynthesized), _wasHeld(false), _isClick(false), _accepted(false) + , _flags(Qt::MouseEventFlags(0)) {} void reset(qreal x, qreal y, Qt::MouseButton button, Qt::MouseButtons buttons, - Qt::KeyboardModifiers modifiers, bool isClick = false, bool wasHeld = false) + Qt::KeyboardModifiers modifiers, bool isClick = false, bool wasHeld = false, + Qt::MouseEventFlags flags = 0) { _x = x; _y = y; @@ -150,6 +153,7 @@ public: _wasHeld = wasHeld; _isClick = isClick; _accepted = true; + _flags = flags; } qreal x() const { return _x; } @@ -169,7 +173,7 @@ public: bool isAccepted() { return _accepted; } void setAccepted(bool accepted) { _accepted = accepted; } - + int flags() const { return _flags; } private: qreal _x; qreal _y; @@ -180,6 +184,7 @@ private: bool _wasHeld : 1; bool _isClick : 1; bool _accepted : 1; + Qt::MouseEventFlags _flags; }; class QQuickWheelEvent : public QObject |