From 52d9ce4ac87c6be1cdc9106ce359e58f7d791c00 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 8 Jun 2009 12:44:39 +0200 Subject: test that TouchBegin events propagate through widgets with Qt::WA_AcceptTouchEvents --- tests/auto/qtouchevent/tst_qtouchevent.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/auto/qtouchevent/tst_qtouchevent.cpp b/tests/auto/qtouchevent/tst_qtouchevent.cpp index 1550935..7a38d24 100644 --- a/tests/auto/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/qtouchevent/tst_qtouchevent.cpp @@ -172,6 +172,21 @@ void tst_QTouchEvent::touchBeginPropagatesWhenIgnored() QVERIFY(grandchild.seenTouchBegin); QVERIFY(child.seenTouchBegin); QVERIFY(!window.seenTouchBegin); + + // disable touch on grandchild. even though it doesn't accept it, child should still get the + // TouchBegin + grandchild.reset(); + child.reset(); + window.reset(); + grandchild.setAttribute(Qt::WA_AcceptTouchEvents, false); + + touchEvent.ignore(); + res = QApplication::sendEvent(&grandchild, &touchEvent); + QVERIFY(res); + QVERIFY(touchEvent.isAccepted()); + QVERIFY(!grandchild.seenTouchBegin); + QVERIFY(child.seenTouchBegin); + QVERIFY(!window.seenTouchBegin); } void tst_QTouchEvent::touchUpdateAndEndNeverPropagate() -- cgit v0.12