Important: Please read the Qt Code of Conduct -

QML detect touches and touch gestures.

  • Hi,
    I have QQuickPaintedItem in my qml file. I want to detect touches and touch gestures.

    I can listen to touches using mouse events: mousePressEvent(), mouseReleaseEvent(), mouseMoveEvent() and mouseDoubleClickEvent() of QQuickItem.

    For pinch I placed PinchArea over QQuickPaintedItem. However then I can detect pinch gestures but mouse (touch) events are not delivered.

    I also tried to place MouseArea on top of QQuickPaintedItem together with PinchArea but then PinchArea doesn't work even if preventStealing of MouseArea is set to true.

    If I place PinchArea on top of QQuickPaintedItem wogether with MouseArea then pinch gestures are detected but then only OnPOsitionChanged of MouseArea are detected - no OnPressed and onReleased events detected.

    Can you please advise how to detect both touches and touch gestures?

Log in to reply