Simulating touchevents for QML
I’m currently trying to simulate some touch events which should be processed in a MouseArea item in QML. I create and send my touch events like
- QList<QTouchEvent::TouchPoint> touchPoints;
- QTouchEvent::TouchPoint p(1); // the hardcoded touch id is just for testing
- p.setScenePos(QPointF(pt.x, pt.y)); // pt is a simple point structure
- QCoreApplication::sendEvent(my_qmlApplicationViewer->scene(), &touchEvent);
and also set
in a QmlApplicationViewer subclass’ constructor, however the touches never get forwarded into QML code.
Am I something (touch-related) missing?