summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/gestures/tst_gestures.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-05-03 14:26:01 +0200
committerLiang Qi <liang.qi@qt.io>2018-05-03 14:50:22 +0200
commit60fefff22f7fa259a8bdb023d1ec9a57cfd34bfb (patch)
treeab33ab6eeb08f7a72e0196ee5025790aaa01b1dd /tests/auto/other/gestures/tst_gestures.cpp
parentb1e0a71997111fc296001bc94e0da8342cf0ac97 (diff)
parentda32360ffc3c7b677355c37ae54c89637c18047f (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: examples/widgets/graphicsview/elasticnodes/graphwidget.cpp examples/widgets/graphicsview/elasticnodes/node.cpp examples/widgets/graphicsview/elasticnodes/node.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_drawing.mm src/widgets/kernel/qmacgesturerecognizer_p.h Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
Diffstat (limited to 'tests/auto/other/gestures/tst_gestures.cpp')
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index 0767efb817..9abe9a77c0 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -331,6 +331,9 @@ private slots:
void graphicsViewParentPropagation();
void panelPropagation();
void panelStacksBehindParent();
+#ifdef Q_OS_MACOS
+ void deleteMacPanGestureRecognizerTargetWidget();
+#endif
void deleteGestureTargetWidget();
void deleteGestureTargetItem_data();
void deleteGestureTargetItem();
@@ -1807,6 +1810,31 @@ void tst_Gestures::panelStacksBehindParent()
QCOMPARE(panel->gestureOverrideEventsReceived, 0);
}
+#ifdef Q_OS_MACOS
+void tst_Gestures::deleteMacPanGestureRecognizerTargetWidget()
+{
+ QWidget window;
+ window.resize(400,400);
+ QGraphicsScene scene;
+ QGraphicsView *view = new QGraphicsView(&scene, &window);
+ view->resize(400, 400);
+ window.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+ QTouchDevice *device = QTest::createTouchDevice();
+ // QMacOSPenGestureRecognizer will start a timer on a touch press event
+ QTest::touchEvent(&window, device).press(1, QPoint(100, 100), &window);
+ delete view;
+
+ // wait until after that the QMacOSPenGestureRecognizer timer (300ms) is triggered.
+ // This is needed so that the whole test does not finish before the timer triggers
+ // and to make sure it crashes while executing *this* function. (otherwise it might give the
+ // impression that some of the subsequent test function caused the crash...)
+
+ QTest::qWait(400); // DO NOT CRASH while waiting
+}
+#endif
+
void tst_Gestures::deleteGestureTargetWidget()
{
}