diff options
author | mread <qt-info@nokia.com> | 2010-07-02 10:50:23 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2010-07-02 10:50:23 (GMT) |
commit | 65316c0fcf9f0a406fd714622407e2b0e767fe7b (patch) | |
tree | b22c5f1d6d314a972302b8a996bde43dc3ddd2af /tests/auto/qmenubar/tst_qmenubar.cpp | |
parent | 36f4d17a139c58cf00d3d9222dd2d35603ac09e8 (diff) | |
parent | 1636e03a2fda5108cb4389689a327e65c47dfe0e (diff) | |
download | Qt-65316c0fcf9f0a406fd714622407e2b0e767fe7b.zip Qt-65316c0fcf9f0a406fd714622407e2b0e767fe7b.tar.gz Qt-65316c0fcf9f0a406fd714622407e2b0e767fe7b.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts fixed:
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'tests/auto/qmenubar/tst_qmenubar.cpp')
-rw-r--r-- | tests/auto/qmenubar/tst_qmenubar.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 4cb63a1..cc9fb0c 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -168,6 +168,7 @@ private slots: void task256322_highlight(); void menubarSizeHint(); void taskQTBUG4965_escapeEaten(); + void taskQTBUG11823_crashwithInvisibleActions(); #if defined(QT3_SUPPORT) void indexBasedInsertion_data(); @@ -1690,6 +1691,34 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten() QTRY_VERIFY(!menubar.isVisible()); } +void tst_QMenuBar::taskQTBUG11823_crashwithInvisibleActions() +{ + QMenuBar menubar; + menubar.setNativeMenuBar(false); //we can't check the geometry of native menubars + + QAction * m = menubar.addAction( "&m" ); + QAction * a = menubar.addAction( "&a" ); + + menubar.show(); + QApplication::setActiveWindow(&menubar); + QTest::qWaitForWindowShown(&menubar); + menubar.setActiveAction(m); + QCOMPARE(menubar.activeAction(), m); + QTest::keyClick(0, Qt::Key_Right); + QCOMPARE(menubar.activeAction(), a); + QTest::keyClick(0, Qt::Key_Right); + QCOMPARE(menubar.activeAction(), m); + a->setVisible(false); + + menubar.setActiveAction(m); + QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed + + //it used to crash here because the action is invisible + QTest::keyClick(0, Qt::Key_Right); + QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed +} + + #if defined(QT3_SUPPORT) void tst_QMenuBar::indexBasedInsertion_data() { |