diff options
author | Caroline Chao <caroline.chao@digia.com> | 2013-03-12 09:24:16 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-12 15:59:21 +0100 |
commit | a410273fabb294b46b04f7ccee38bab668413061 (patch) | |
tree | 23859f6c3c2e770880fcf71edfc88114f62f05fa /tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | |
parent | ec9c0faefd43b099bf7472daa932a865ddf8112c (diff) |
Fix wrong initial position
If the widget is larger than the screen,
its title bar top left corner will be shown
inside the screen.
Task-number: QTBUG-30142
Change-Id: Id93773874be3616b3ef4b9bee6e1bb751c541d7b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index e6b1caf694..3d7cc14a5d 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -412,6 +412,7 @@ private slots: void keyboardModifiers(); void mouseDoubleClickBubbling_QTBUG29680(); + void largerThanScreen_QTBUG30142(); private: bool ensureScreenSize(int width, int height); @@ -10074,5 +10075,20 @@ void tst_QWidget::mouseDoubleClickBubbling_QTBUG29680() QTRY_VERIFY(parent.triggered); } +void tst_QWidget::largerThanScreen_QTBUG30142() +{ + QWidget widget; + widget.resize(200, 4000); + widget.show(); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); + QVERIFY(widget.frameGeometry().y() >= 0); + + QWidget widget2; + widget2.resize(10000, 400); + widget2.show(); + QVERIFY(QTest::qWaitForWindowExposed(&widget2)); + QVERIFY(widget2.frameGeometry().x() >= 0); +} + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" |