Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48666

[OSX]Broken gesture delivery

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.1
    • 5.5.1
    • QPA
    • None
    • OSX 10.11 Qt 5.5.1
    • macOS
    • 455f5df5412cd0dcbf2b7985df74be0a066b634e

    Description

      
      #include <QWidget>
      #include <QApplication>
      #include <QDebug>
      
      class Widget : public QWidget
      {
      public:
        Widget(QWidget *parent = 0):
          QWidget(parent)
        {
          grabGesture(Qt::PinchGesture);
        }
      
        bool event(QEvent *);
      };
      
      #include <QPinchGesture>
      bool Widget::event(QEvent* e)
      {
        if(e->type() == QEvent::Gesture)
        {
          QGestureEvent* ge = static_cast<QGestureEvent*>(e);
      
          ge->accept(Qt::PinchGesture); //< not really needed
          
          if(QPinchGesture* pinch = static_cast<QPinchGesture *>(ge->gesture(Qt::PinchGesture)))
          {
            qDebug()<<pinch->state();
          }
      
        }
      
        return QWidget::event(e);
      }
      
      int main(int argc, char ** argv)
      {
        QApplication app(argc, argv);
      
         Widget w;
         w.show();
      
         return app.exec();
      }
      
      • Compile and run the code above on a Mac with a modern trackpad;
      • Begin Magnify or Rotate two finger gesture;
      • Qt::GestureState(GestureStarted) is reported, then a stream of Qt::GestureState(GestureUpdated);
      • complete the gesture, lifting your fingers;
      • No Qt::GestureState(GestureFinished) is delivered and no future GestureStarted - only GestureUpdated for the rest of the application run!

      Note: using a MacEventFilter does show all phases delivered correctly.

      Attachments

        For Gerrit Dashboard: QTBUG-48666
        # Subject Branch Project Status CR V

        Activity

          People

            tpochep Timur Pocheptsov
            mnaydenov Mihail Naydenov
            Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes