summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-10 13:56:25 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-10 13:57:40 (GMT)
commit6d44daddab9f36fd8c34bb3776c0fb0d93635e6e (patch)
tree62108a82979bdf09cb9b5bd48423edfab3965dfc /tests/auto
parent28fc7434e0be95527292050bc6dd3980aabd44ca (diff)
downloadQt-6d44daddab9f36fd8c34bb3776c0fb0d93635e6e.zip
Qt-6d44daddab9f36fd8c34bb3776c0fb0d93635e6e.tar.gz
Qt-6d44daddab9f36fd8c34bb3776c0fb0d93635e6e.tar.bz2
Fixed dialog resize not to move the dialog for Symbian.
QDialog::resize() also moved the dialog in Symbian. This occured since adjustPosition was called as an result of resize and that method did not check if dialog position was explicitly set. In addition it was found that in Symbian WA_Resized and WA_Moved attributes were basically set for almost all top-level widgets by system. This was also fixed and a new auto test was introduced to verify these attributes in all platforms. Windows platform also suffers from bug in this area, and a separate task QTBUG-5897 for it was created Task-number: QTBUG-5897 Reviewed-by: Sami Merila
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index abd9604..f03b7d7 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -402,6 +402,7 @@ private slots:
void scrollWithoutBackingStore();
void taskQTBUG_7532_tabOrderWithFocusProxy();
+ void movedAndResizedAttributes();
private:
bool ensureScreenSize(int width, int height);
@@ -10040,5 +10041,57 @@ void tst_QWidget::taskQTBUG_7532_tabOrderWithFocusProxy()
// No Q_ASSERT, then it's allright.
}
+void tst_QWidget::movedAndResizedAttributes()
+{
+ QWidget w;
+ w.show();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.setWindowState(Qt::WindowFullScreen);
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.setWindowState(Qt::WindowMaximized);
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.setWindowState(Qt::WindowMinimized);
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showNormal();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showMaximized();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showFullScreen();
+
+ QVERIFY(!w.testAttribute(Qt::WA_Moved));
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.showNormal();
+ w.move(10,10);
+ QVERIFY(w.testAttribute(Qt::WA_Moved));
+#if defined(Q_OS_WIN)
+ QEXPECT_FAIL("", "FixMe, QTBUG-8911", Abort);
+#endif
+ QVERIFY(!w.testAttribute(Qt::WA_Resized));
+
+ w.resize(100, 100);
+ QVERIFY(w.testAttribute(Qt::WA_Moved));
+ QVERIFY(w.testAttribute(Qt::WA_Resized));
+
+}
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"