diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-12-08 16:59:14 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-12-09 10:28:50 +0000 |
commit | c363b0324ac7a19e8c30c075ce001da0a0a8b6bd (patch) | |
tree | 55b5ac3549475d258b344dc9b75788acf6c3ecfc /src/quick/handlers/qquickpointerhandler_p.h | |
parent | c79d397925d535d72c0407af7c45f6b35df64cc2 (diff) |
add virtual QQuickPointerHandler::onActiveChanged
and override it in PinchHandler. Many handlers will need to do
something in response to change in active state, so calling a virtual
when the state changes and overriding it in subclasses is more
efficient than for subclasses to connect to the activeChanged signal.
This also helps us control the signal emit order: the subclass can
deal with any consequences (such as changing its own properties) before
activeChanged is emitted.
Change-Id: I6d05643e8facfd1941aa9152de6865932edb1b3a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpointerhandler_p.h')
-rw-r--r-- | src/quick/handlers/qquickpointerhandler_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h index 5e691bea5e..95900c50f0 100644 --- a/src/quick/handlers/qquickpointerhandler_p.h +++ b/src/quick/handlers/qquickpointerhandler_p.h @@ -94,8 +94,9 @@ Q_SIGNALS: protected: QQuickPointerEvent *currentEvent() { return m_currentEvent; } virtual bool wantsPointerEvent(QQuickPointerEvent *event); - virtual void setActive(bool active); virtual void handlePointerEventImpl(QQuickPointerEvent *event); + void setActive(bool active); + virtual void onActiveChanged() { } void setGrab(QQuickEventPoint *point, bool grab); virtual void handleGrabCancel(QQuickEventPoint *point); QPointF eventPos(const QQuickEventPoint *point) const; |