diff options
-rw-r--r-- | tests/auto/gestures/tst_gestures.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index ddc3939..667cdd3 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -41,6 +41,7 @@ #include <QtTest/QtTest> +#include <QtTest/qtesttouch.h> #include "../../shared/util.h" #include <qevent.h> @@ -361,6 +362,7 @@ private slots: void partialGesturePropagation(); void testQGestureRecognizerCleanup(); void testReuseCanceledGestures(); + void bug_13501_gesture_not_accepted(); }; tst_Gestures::tst_Gestures() @@ -2306,5 +2308,29 @@ void tst_Gestures::conflictingGesturesInGraphicsView() QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount); } +class NoConsumeWidgetBug13501 :public QWidget +{ + Q_OBJECT +protected: + bool event(QEvent *e) { + if(e->type() == QEvent::Gesture) { + return false; + } + return QWidget::event(e); + } +}; + +void tst_Gestures::bug_13501_gesture_not_accepted() +{ + // Create a gesture event that is not accepted by any widget + // make sure this does not lead to an assert in QGestureManager + NoConsumeWidgetBug13501 w; + w.grabGesture(Qt::TapGesture); + w.show(); + QTest::qWaitForWindowShown(&w); + //QTest::mousePress(&ignoreEvent, Qt::LeftButton); + QTest::touchEvent(&w).press(0, QPoint(10, 10), &w); +} + QTEST_MAIN(tst_Gestures) #include "tst_gestures.moc" |