diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-09-11 08:13:28 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-09-11 08:13:28 (GMT) |
commit | dacb14e457b40b6839e9f17ec968e95e29113d20 (patch) | |
tree | 380423d4f3d3cae9c8e2e628b2931404c6499b78 /tests | |
parent | f9243aac1e26ccf9f46cc1d7de5f57063a053211 (diff) | |
download | Qt-dacb14e457b40b6839e9f17ec968e95e29113d20.zip Qt-dacb14e457b40b6839e9f17ec968e95e29113d20.tar.gz Qt-dacb14e457b40b6839e9f17ec968e95e29113d20.tar.bz2 |
Fixed QWidget::setWindowState for Symbian.
Before this commit calling setWindowState(Qt::WindowFullScreen) on
a widget instance affected all new widget instances created after this
method.
This bug happened due to fact that window decorations i.e. statuspane
and softkeys visibility was only changed when switching to or from
fullscreen state. In the reported bug it happened that second widget
was initially in Qt::WindowNoState and it was changed to Maximized.
Since window decorations are global not window specific at the moment,
the default decoration visibility for second window is the one to which
previous window has set them. In this case previous window was in
fullscreen and that's why the decorations were visible also for
second maximized window.
Probably the right fix would be to change the decoration to window
specific but that is quite a big change and for now the bug is fixed
with this commit.
Autotest: Excluding new test case, same results before and after.
Task-number: 261048
Reviewed-by: Jason Barron
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qwidget/qwidget.pro | 1 | ||||
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro index 59c1753..def28f5 100644 --- a/tests/auto/qwidget/qwidget.pro +++ b/tests/auto/qwidget/qwidget.pro @@ -16,6 +16,7 @@ OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm symbian { INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -leikcore -lcone -leikcoctl } !wince*:!symbian:win32: LIBS += -luser32 -lgdi32 diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index b94f381..230b7c9 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -74,6 +74,7 @@ #include <akntitle.h> // CAknTitlePane #include <akncontext.h> // CAknContextPane #include <eikspane.h> // CEikStatusPane +#include <eikbtgpc.h> // CEikButtonGroupContainer #endif #ifdef Q_WS_QWS @@ -366,6 +367,10 @@ private slots: void setGraphicsEffect(); void destroyBackingStore(); + +#ifdef Q_OS_SYMBIAN + void cbaVisibility(); +#endif private: bool ensureScreenSize(int width, int height); @@ -9323,5 +9328,43 @@ void tst_QWidget::setGraphicsEffect() delete anotherWidget; } +#ifdef Q_OS_SYMBIAN +void tst_QWidget::cbaVisibility() +{ + // Test case for task 261048 + + // Create first mainwindow in fullsreen and activate it + QMainWindow* mainwindow = new QMainWindow(); + QLabel* label = new QLabel(mainwindow); + mainwindow->setCentralWidget(label); + mainwindow->setWindowState(Qt::WindowFullScreen); + mainwindow->setVisible(true); + mainwindow->activateWindow(); + qApp->processEvents(); + + QVERIFY(mainwindow->isActiveWindow()); + QVERIFY(QDesktopWidget().availableGeometry().size() == mainwindow->size()); + + // Create second mainwindow in maximized and activate it + QMainWindow* mainwindow2 = new QMainWindow(); + QLabel* label2 = new QLabel(mainwindow2); + mainwindow2->setCentralWidget(label2); + mainwindow2->setWindowState(Qt::WindowMaximized); + mainwindow2->setVisible(true); + mainwindow2->activateWindow(); + qApp->processEvents(); + + QVERIFY(!mainwindow->isActiveWindow()); + QVERIFY(mainwindow2->isActiveWindow()); + QVERIFY(QDesktopWidget().availableGeometry().size() == mainwindow2->size()); + + // Verify window decorations i.e. status pane and CBA are visible. + CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); + QVERIFY(statusPane->IsVisible()); + CEikButtonGroupContainer* buttonGroup = CEikonEnv::Static()->AppUiFactory()->Cba(); + QVERIFY(buttonGroup->IsVisible()); +} +#endif + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" |