aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpointerhandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-03-26 16:50:40 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-06-23 17:44:03 +0200
commitd0ae3a312a03c118a1aa25a4c6c0352375d569fc (patch)
tree01df3e8ea22c8a1ecd969a6e9e6d7014c635da9f /src/quick/handlers/qquickpointerhandler.cpp
parentd5d6a56809032796444fe63c220a2e940ce237c0 (diff)
Remove QQuickPointerDevice in favor of QPointingDevice
...and generally deal with changes immediately required after adding QInputDevice and QPointingDevice. Also fixed a few usages of deprecated accessors that weren't taken care of in 212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad. Task-number: QTBUG-46412 Task-number: QTBUG-69433 Task-number: QTBUG-72167 Change-Id: I93a2643162878afa216556f10808fd92e0b20071 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.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index adb753e000..2a02511402 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -40,6 +40,7 @@
#include "qquickpointerhandler_p.h"
#include "qquickpointerhandler_p_p.h"
#include <QtQuick/private/qquickitem_p.h>
+#include <QtGui/private/qinputdevice_p.h>
QT_BEGIN_NAMESPACE
@@ -598,7 +599,7 @@ void QQuickPointerHandler::handlePointerEvent(QQuickPointerEvent *event)
pt->cancelExclusiveGrab();
}
}
- event->device()->eventDeliveryTargets().append(this);
+ QQuickPointerHandlerPrivate::deviceDeliveryTargets(event->device()).append(this);
}
bool QQuickPointerHandler::wantsPointerEvent(QQuickPointerEvent *event)
@@ -715,4 +716,14 @@ bool QQuickPointerHandlerPrivate::dragOverThreshold(const QQuickEventPoint *poin
dragOverThreshold(delta.y(), Qt::YAxis, point));
}
+QVector<QObject *> &QQuickPointerHandlerPrivate::deviceDeliveryTargets(const QInputDevice *device)
+{
+ QInputDevicePrivate *devPriv = QInputDevicePrivate::get(const_cast<QInputDevice *>(device));
+ if (devPriv->qqExtra)
+ return *static_cast<QVector<QObject *>*>(devPriv->qqExtra);
+ auto targets = new QVector<QObject *>;
+ devPriv->qqExtra = targets;
+ return *targets;
+}
+
QT_END_NAMESPACE