aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-06-01 11:24:21 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-06-20 22:02:02 +0000
commitacc1c7bcdf8cc03a0b3ed3d8f3957d0ce3f2bc2c (patch)
treec5d1b733c08a5c567453dbdfea1bf0589f79def3 /src
parentf62abf14b0cc940b07e8fee84be979f34478ae2b (diff)
Move wantsEventPoint() up from SinglePointHandler to QQPointerHandler
We want to be able to call it from the upcoming QQuickItemPrivate::anyPointerHandlerWants function. Change-Id: I15ef60303fa56f43e66b16c8dd0f4102070536d0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp5
-rw-r--r--src/quick/handlers/qquickpointerhandler_p.h1
-rw-r--r--src/quick/handlers/qquicksinglepointhandler.cpp5
-rw-r--r--src/quick/handlers/qquicksinglepointhandler_p.h1
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 506da8faff..a0325dd0c6 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -410,6 +410,11 @@ bool QQuickPointerHandler::wantsPointerEvent(QQuickPointerEvent *event)
return d->enabled;
}
+bool QQuickPointerHandler::wantsEventPoint(QQuickEventPoint *point)
+{
+ return parentContains(point);
+}
+
/*!
\readonly
\qmlproperty bool QtQuick::PointerHandler::active
diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h
index b388558c6a..1327e6be4e 100644
--- a/src/quick/handlers/qquickpointerhandler_p.h
+++ b/src/quick/handlers/qquickpointerhandler_p.h
@@ -122,6 +122,7 @@ protected:
QQuickPointerEvent *currentEvent();
virtual bool wantsPointerEvent(QQuickPointerEvent *event);
+ virtual bool wantsEventPoint(QQuickEventPoint *point);
virtual void handlePointerEventImpl(QQuickPointerEvent *event);
void setActive(bool active);
virtual void onTargetChanged(QQuickItem *oldTarget) { Q_UNUSED(oldTarget); }
diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp
index 5ed41b96f2..04b4214bab 100644
--- a/src/quick/handlers/qquicksinglepointhandler.cpp
+++ b/src/quick/handlers/qquicksinglepointhandler.cpp
@@ -145,11 +145,6 @@ void QQuickSinglePointHandler::handlePointerEventImpl(QQuickPointerEvent *event)
}
}
-bool QQuickSinglePointHandler::wantsEventPoint(QQuickEventPoint *point)
-{
- return parentContains(point);
-}
-
void QQuickSinglePointHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabState stateChange, QQuickEventPoint *point)
{
if (grabber != this)
diff --git a/src/quick/handlers/qquicksinglepointhandler_p.h b/src/quick/handlers/qquicksinglepointhandler_p.h
index e4b0584a08..66ef1dbeb2 100644
--- a/src/quick/handlers/qquicksinglepointhandler_p.h
+++ b/src/quick/handlers/qquicksinglepointhandler_p.h
@@ -77,7 +77,6 @@ Q_SIGNALS:
protected:
bool wantsPointerEvent(QQuickPointerEvent *event) override;
- virtual bool wantsEventPoint(QQuickEventPoint *point);
void handlePointerEventImpl(QQuickPointerEvent *event) override;
virtual void handleEventPoint(QQuickEventPoint *point) = 0;
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index 902ff0df10..b12894e23f 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -107,7 +107,7 @@ QQuickTapHandler::~QQuickTapHandler()
{
}
-static bool dragOverThreshold(QQuickEventPoint *point)
+static bool dragOverThreshold(const QQuickEventPoint *point)
{
QPointF delta = point->scenePosition() - point->scenePressPosition();
return (QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, point) ||