diff options
author | axis <qt-info@nokia.com> | 2010-09-27 06:57:02 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-09-27 07:24:21 (GMT) |
commit | 389a27400a4b95133ec7963b1d81f3317056a286 (patch) | |
tree | f9fb51ecb7a5e933b5dd67a5ffebfc20480ec50e /tests/auto/qwidget | |
parent | 0ec3281f7deb9a0c5bdc26481bf5c0fb8d3ae750 (diff) | |
download | Qt-389a27400a4b95133ec7963b1d81f3317056a286.zip Qt-389a27400a4b95133ec7963b1d81f3317056a286.tar.gz Qt-389a27400a4b95133ec7963b1d81f3317056a286.tar.bz2 |
Made the Symbian menu close when switching native focus.
This was required to avoid windows appearing on top of the popup
menu, preventing both the menu and the softkeys from being used.
Task: QTBUG-9965
AutoTest: Included
RevBy: Jason Barron
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 098ce3c..2f221d2 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -70,6 +70,7 @@ #include <qtoolbar.h> #include <QtGui/qpaintengine.h> #include <private/qbackingstore_p.h> +#include <qmenubar.h> #include <QtGui/QGraphicsView> #include <QtGui/QGraphicsProxyWidget> @@ -81,8 +82,14 @@ #include <avkon.hrh> // EEikStatusPaneUidTitle #include <akntitle.h> // CAknTitlePane #include <akncontext.h> // CAknContextPane +#endif + +#ifdef Q_OS_SYMBIAN #include <eikspane.h> // CEikStatusPane #include <eikbtgpc.h> // CEikButtonGroupContainer +#include <eikenv.h> // CEikonEnv +#include <eikaufty.h> // MEikAppUiFactory +#include <eikmenub.h> // CEikMenuBar #endif #ifdef Q_WS_QWS @@ -387,6 +394,7 @@ private slots: void maximizedWindowModeTransitions(); void minimizedWindowModeTransitions(); void normalWindowModeTransitions(); + void focusSwitchClosesPopupMenu(); #endif void focusProxyAndInputMethods(); @@ -10253,6 +10261,31 @@ void tst_QWidget::normalWindowModeTransitions() QVERIFY(!buttonGroup->IsVisible()); QVERIFY(!statusPane->IsVisible()); } + +void tst_QWidget::focusSwitchClosesPopupMenu() +{ + QMainWindow mainWindow; + QAction action("Test action", &mainWindow); + mainWindow.menuBar()->addAction(&action); + + mainWindow.show(); + QT_TRAP_THROWING(CEikonEnv::Static()->AppUiFactory()->MenuBar()->TryDisplayMenuBarL()); + QVERIFY(CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed()); + + // Close the popup by opening a new window. + QMainWindow mainWindow2; + QAction action2("Test action", &mainWindow2); + mainWindow2.menuBar()->addAction(&action2); + mainWindow2.show(); + QVERIFY(!CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed()); + + QT_TRAP_THROWING(CEikonEnv::Static()->AppUiFactory()->MenuBar()->TryDisplayMenuBarL()); + QVERIFY(CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed()); + + // Close the popup by switching focus. + mainWindow.activateWindow(); + QVERIFY(!CEikonEnv::Static()->AppUiFactory()->MenuBar()->IsDisplayed()); +} #endif class InputContextTester : public QInputContext |