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

QPanGesture is not detected on Mac

    XMLWordPrintable

Details

    • macOS
    • 30bb830fc1b73834f459becaa141d0f7a1afa51c

    Description

      With this test code, only pinch is detected.

      #include <QMainWindow>
      #include <QGestureEvent>
      #include <QPanGesture>
      #include <QPinchGesture>
      #include <QDebug>
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      public:
          MainWindow() {
              grabGesture(Qt::PanGesture);
              grabGesture(Qt::PinchGesture);
          }
          bool event(QEvent* event) {
              if (event->type() == QEvent::Gesture) {
                  QGestureEvent *gesture = static_cast<QGestureEvent*>(event);
                  if (QPinchGesture *pinch = static_cast<QPinchGesture *>(
                              gesture->gesture(Qt::PinchGesture))) {
                      qDebug() << "Pinch";
                  }
                  if (QPanGesture *pan = static_cast<QPanGesture *>(
                              gesture->gesture(Qt::PanGesture))) {
                      qDebug() << "Pan";
                   }
              }
              return QWidget::event(event);
          }
      };
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sorvig Morten Sørvig
              yufanyufan Fan Yu
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes