aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-12-28 10:05:36 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-01-12 14:52:51 +0000
commitfc9b36c23680469bc6ca9f8a220045e67c7fb6c3 (patch)
tree336f893b2f1a455d466ba4a1096887217d51dd1a /src/quick/handlers/qquickpointerhandler.cpp
parent2e8a45d99f94cbd2c805dd3de56d60d9baa9bd4e (diff)
QQuickPointerHandler: add virtual onTargetChanged()
To be overridden in handlers which need to know when this happens, to avoid connecting to the targetChanged() signal. Change-Id: I51432b69d05fd541eb62e0cd01f4019e336816ac 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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 64bf1a8a8b..d6d3a52d95 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -331,7 +331,9 @@ void QQuickPointerHandler::setTarget(QQuickItem *target)
if (m_target == target)
return;
+ QQuickItem *oldTarget = m_target;
m_target = target;
+ onTargetChanged(oldTarget);
emit targetChanged();
}