Important: Please read the Qt Code of Conduct -

Android gestures

  • I have a Qt 5.11.2 app running on Lenovo Tab E10 tablet. In a custom widget, I would like to receive gestures.

    I called this in constructor of the widget:

    setAttribute( Qt::WA_AcceptTouchEvents );
    grabGesture( Qt::PinchGesture );

    I then implemented method in my widget:

    bool QCustomPlot::event( QEvent *event ){
        qDebug() << "QCustomPlot::event" << event->type();

    However, for two fingers pinch gesture I only receive QEvent::Type(MouseButtonPress), multiple QEvent::Type(MouseMove) and QEvent::Type(MouseButtonRelease) events.

    I would be able to build pinch gesture from mouse events but I never receive any event for second finger touching the screen.

    So, how to enable pinch gesture on my tablet? If it is not possible, how can I build pinch gesture from mouse events?

  • I've never read anyone succeed in this and if you don't get events for the other finger, it might be impossible.

  • Banned

    This post is deleted!

Log in to reply