diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-10-21 11:01:21 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-31 09:55:07 +0100 |
commit | 5761d8546f3ff3802cae85ed5224c2bdd9524452 (patch) | |
tree | acaf3b5d808c6112a3f5423f468e52a32ea083ee /tests/auto/widgets | |
parent | 79fb588030fbfec9f5e8cc2d81c90965e181631f (diff) |
Correctly handle null windows or widgets in keyClick()
Allow passing of null windows or widgets to keyClick().
In that case route the event through the normal Qt event
processing. This allows e.g. shortcuts to catch the
key event.
Change-Id: Ic9455ea9be5164918b1c0bccbd58dd32eae74ff1
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index 4a6123cdc3..f620b9b9be 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -1249,10 +1249,12 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten() menubar.setActiveAction(first); QTRY_VERIFY(menu.isVisible()); QCOMPARE(menubar.activeAction(), first); + QTest::qWaitForWindowShown(&menu); QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape); QVERIFY(!menu.isVisible()); QTRY_VERIFY(menubar.hasFocus()); QCOMPARE(menubar.activeAction(), first); + QTest::qWait(200); QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape); QVERIFY(!menubar.activeAction()); QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape); //now the action should be triggered |