diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-14 19:11:05 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-14 19:11:05 (GMT) |
commit | 2a1c4cbca0db45fa911b6d4e9a5ae553f8289353 (patch) | |
tree | 2336957d7c13821745c5e3215b0c322bbeed8ddd /tests/auto | |
parent | 30b415bf8644961d3e5b108b0b7c1b1abf07f685 (diff) | |
parent | 33f9950996ada06fc39b68f6656b1defdccd8c3a (diff) | |
download | Qt-2a1c4cbca0db45fa911b6d4e9a5ae553f8289353.zip Qt-2a1c4cbca0db45fa911b6d4e9a5ae553f8289353.tar.gz Qt-2a1c4cbca0db45fa911b6d4e9a5ae553f8289353.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
fix QTBUG-13501 - crash when a gesture is accepted but not consumed
Add test: assert when gesture is never accepted.
Diffstat (limited to 'tests/auto')
-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" |