Fix touch on PointerHandlers

The events we forward to the offscreen QML view are with our own
QPointingDevice instance, which has a devicetype of touch but a null pointerType.

In Qt5 this was enough, but pointerhandlers in qt6 refuse events with an undefined
pointertype, so we have to explicitly set it to finger

BUG:473541
This commit is contained in:
Marco Martin 2023-09-13 13:25:57 +00:00 committed by Xaver Hugl
parent 36513123f3
commit 3a95c20279

View file

@ -146,7 +146,7 @@ OffscreenQuickView::OffscreenQuickView(QObject *parent, ExportMode exportMode)
connect(d->m_renderControl.get(), &QQuickRenderControl::renderRequested, this, &OffscreenQuickView::handleRenderRequested);
connect(d->m_renderControl.get(), &QQuickRenderControl::sceneChanged, this, &OffscreenQuickView::handleSceneChanged);
d->touchDevice = new QPointingDevice({}, {}, QInputDevice::DeviceType::TouchScreen, {}, QInputDevice::Capability::Position, 10, {});
d->touchDevice = new QPointingDevice(QStringLiteral("ForwardingTouchDevice"), {}, QInputDevice::DeviceType::TouchScreen, QPointingDevice::PointerType::Finger, QInputDevice::Capability::Position, 10, {});
}
OffscreenQuickView::~OffscreenQuickView()