Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.12.0
-
None
-
macOS 10.13.6 (17G4015)
Xcode 10.1 (10B61)
Description
Trying to grab swipe gestures on QWidget objects with grabGesture(Qt::SwipeGesture) does not work. QWidget::event() never receives a QGestureEvent. Grabbing other gestures (like Qt::TapGesture or Qt::TapHoldGesture) works fine. Qt::SwipeGesture does not.
Code that reproduces the issue:
#include <QApplication> #include <QGestureEvent> #include <QMainWindow> class MainWindow: public QMainWindow { protected: bool event(QEvent* e) override { if (e->type() == QEvent::Gesture) { auto* gestEv = static_cast<QGestureEvent*>(e); if (gestEv->gesture(Qt::SwipeGesture) != nullptr) { abort(); } } return false; } }; int main(int argc, char* argv[]) { QApplication a(argc, argv); MainWindow w; w.grabGesture(Qt::SwipeGesture); w.show(); return a.exec(); }
Swiping does not abort the app. This is true for both the iOS Simulator as well as real hardware (iPhone 8 and iPad Air.)
Attachments
Issue Links
- relates to
-
QTBUG-15768 Swipe gesture doesn't work with the imagegestures example
-
- Open
-
-
QTBUG-138601 Swipe gesture does not work on Windows
-
- In Progress
-
-
QTBUG-46195 [Windows]: Swipe gesture is not always recognized and sometimes in the wrong direction
-
- Closed
-
-
QTBUG-14895 Qt Gestures - Pan and Swipe are not working
-
- Closed
-
-
QTBUG-30741 When using -no-native-gestures on Windows, the swipe gesture is not picked up
-
- Closed
-
-
QTBUG-37759 QWidget-gestures do not work
-
- Closed
-