diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-22 15:15:58 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-24 14:27:33 +0000 |
commit | be763508cf45e34970c9969b49d974061bdb6c92 (patch) | |
tree | e349d43ff937e0810faff9acee229afb06343540 /src/quick/handlers/qquickpointerhandler_p.h | |
parent | 76c627b1db48390e61d1320d33743447690d3d4d (diff) |
add QQuickPointerHandler::active property
By default, a handler is active whenever wantsPointerEvent() returns
true, and inactive when it returns false.
Change-Id: I627762ba8f4eed167f675f220ffaed79c93c8448
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/quick/handlers/qquickpointerhandler_p.h')
-rw-r--r-- | src/quick/handlers/qquickpointerhandler_p.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h index ada77d8eaa..d7ac713638 100644 --- a/src/quick/handlers/qquickpointerhandler_p.h +++ b/src/quick/handlers/qquickpointerhandler_p.h @@ -64,6 +64,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerHandler : public QObject { Q_OBJECT Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) + Q_PROPERTY(bool active READ active NOTIFY activeChanged) Q_PROPERTY(QQuickItem * target READ target WRITE setTarget NOTIFY targetChanged) public: @@ -74,6 +75,8 @@ public: bool enabled() const { return m_enabled; } void setEnabled(bool enabled); + bool active() const { return m_active; } + QQuickItem *target() const { return m_target; } void setTarget(QQuickItem *target); @@ -81,11 +84,13 @@ public: Q_SIGNALS: void enabledChanged(); + void activeChanged(); void targetChanged(); protected: QQuickPointerEvent *currentEvent() { return m_currentEvent; } virtual bool wantsPointerEvent(QQuickPointerEvent *event); + virtual void setActive(bool active); virtual void handlePointerEventImpl(QQuickPointerEvent *event); void setGrab(QQuickEventPoint *point, bool grab); QPointF eventPos(const QQuickEventPoint *point) const; @@ -94,7 +99,8 @@ protected: private: QQuickPointerEvent *m_currentEvent; QQuickItem *m_target; - bool m_enabled; + bool m_enabled : 1; + bool m_active : 1; }; QT_END_NAMESPACE |