aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-08-15 17:25:41 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-16 13:13:32 +0000
commit6ba9707e38ae3e2f59aeb35d5367093a7e513165 (patch)
treea363660fdfc33269e620cb79993bbcf12bb5122e /src/quick/handlers/qquickpointerhandler.cpp
parent199692e06c839c64dd888a0a85c403e5c247c40e (diff)
add QQuickPointerHandler::targetContains(QQuickEventPoint*)
Most handlers will need to check this. Change-Id: I44858c0ac4ccb58a9a2de70382e3954af6554ef3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/quick/handlers/qquickpointerhandler.cpp')
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 37238c4d51..c0815a5a27 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -76,6 +76,13 @@ QPointF QQuickPointerHandler::eventPos(const QQuickEventPoint *point) const
return (m_target ? m_target->mapFromScene(point->scenePos()) : point->scenePos());
}
+bool QQuickPointerHandler::targetContains(const QQuickEventPoint *point) const
+{
+ if (!m_target || !point)
+ return false;
+ return m_target->contains(m_target->mapFromScene(point->scenePos()));
+}
+
/*!
\qmlproperty QQuickPointerHandler::enabled