summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-11 11:13:28 +0300
committerJanne Anttila <janne.anttila@digia.com>2009-09-11 11:13:28 +0300
commitdacb14e457b40b6839e9f17ec968e95e29113d20 (patch)
tree380423d4f3d3cae9c8e2e628b2931404c6499b78 /tests/auto/qwidget/tst_qwidget.cpp
parentf9243aac1e26ccf9f46cc1d7de5f57063a053211 (diff)
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/auto/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index b94f381088..230b7c954a 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"