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.cpp | |
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.cpp')
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index 9f7b1c4cd0..da8fccbfa0 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -153,6 +153,7 @@ void QQuickPointerHandler::setActive(bool active) { if (m_active != active) { m_active = active; + onActiveChanged(); emit activeChanged(); } } |