diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-03-22 21:49:39 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-12-05 12:11:39 +0000 |
commit | 2fa9c254f34a7b1ad019fd8b71ceb5d6fffdea59 (patch) | |
tree | f69a401ace036a48bdd06dbd0eb72a1a2c21652d /src/quick/handlers/qquicksinglepointhandler_p.h | |
parent | 74d23ca548b47c85c4b8cdde5fd5a9026e4eb08c (diff) |
Refactor QQuickSinglePointHandler into public and private classes
Change-Id: Idf861ce4286e24cecd81f802032243b467950c5e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquicksinglepointhandler_p.h')
-rw-r--r-- | src/quick/handlers/qquicksinglepointhandler_p.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/handlers/qquicksinglepointhandler_p.h b/src/quick/handlers/qquicksinglepointhandler_p.h index b9e5b12224..edc55aaaf6 100644 --- a/src/quick/handlers/qquicksinglepointhandler_p.h +++ b/src/quick/handlers/qquicksinglepointhandler_p.h @@ -56,24 +56,29 @@ QT_BEGIN_NAMESPACE +class QQuickSinglePointHandlerPrivate; + class Q_QUICK_PRIVATE_EXPORT QQuickSinglePointHandler : public QQuickPointerDeviceHandler { Q_OBJECT Q_PROPERTY(QQuickHandlerPoint point READ point NOTIFY pointChanged) + public: explicit QQuickSinglePointHandler(QQuickItem *parent = nullptr); - QQuickHandlerPoint point() const { return m_pointInfo; } + QQuickHandlerPoint point() const; Q_SIGNALS: void pointChanged(); protected: + QQuickSinglePointHandler(QQuickSinglePointHandlerPrivate &dd, QQuickItem *parent); + bool wantsPointerEvent(QQuickPointerEvent *event) override; void handlePointerEventImpl(QQuickPointerEvent *event) override; virtual void handleEventPoint(QQuickEventPoint *point) = 0; - QQuickEventPoint *currentPoint(QQuickPointerEvent *ev) { return ev->pointById(m_pointInfo.m_id); } + QQuickEventPoint *currentPoint(QQuickPointerEvent *ev); void onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabTransition transition, QQuickEventPoint *point) override; void setIgnoreAdditionalPoints(bool v = true); @@ -82,12 +87,7 @@ protected: void setPointId(int id); -private: - void reset(); - -private: - QQuickHandlerPoint m_pointInfo; - bool m_ignoreAdditionalPoints = false; + Q_DECLARE_PRIVATE(QQuickSinglePointHandler) }; QT_END_NAMESPACE |