aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-08-26 16:27:25 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-10-17 14:05:13 +0000
commit68a0023bd5330ff57961240aecdd26e30a62d338 (patch)
treea636a7febc83d7cf41c874580a1a91c72a0fba67 /src/quick/handlers/qquickpointerhandler_p.h
parent37b3c6ecc5cb17021d7251cfca1d6e31d7edda4d (diff)
add QQuickPointerHandler::handleGrabCancel; call in setGrab
Only one handler can be the grabber at one time, so we need to ensure that we notify the others when they lose the grab. Also handle this in QQuickPointerSingleHandler: forget m_currentPointId, so that wantsPointerEvent will not continue to "want" the same ID. Also add the canceled(QQuickEventPoint *point) signal, which is one of the four possible "state signals" (press, update, release, cancel) but which we didn't commit to adding yet. Change-Id: I46256acb75ece863d84e812af2d30cb0b12e3c1f 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h
index d7ac713638..42d9489f84 100644
--- a/src/quick/handlers/qquickpointerhandler_p.h
+++ b/src/quick/handlers/qquickpointerhandler_p.h
@@ -86,6 +86,7 @@ Q_SIGNALS:
void enabledChanged();
void activeChanged();
void targetChanged();
+ void canceled(QQuickEventPoint *point);
protected:
QQuickPointerEvent *currentEvent() { return m_currentEvent; }
@@ -93,6 +94,7 @@ protected:
virtual void setActive(bool active);
virtual void handlePointerEventImpl(QQuickPointerEvent *event);
void setGrab(QQuickEventPoint *point, bool grab);
+ virtual void handleGrabCancel(QQuickEventPoint *point);
QPointF eventPos(const QQuickEventPoint *point) const;
bool targetContains(const QQuickEventPoint *point) const;
@@ -101,6 +103,8 @@ private:
QQuickItem *m_target;
bool m_enabled : 1;
bool m_active : 1;
+
+ friend class QQuickEventPoint;
};
QT_END_NAMESPACE