diff options
author | Andy Shaw <andy.shaw@digia.com> | 2014-05-19 19:58:35 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-26 11:16:38 +0200 |
commit | 5d48eb8bbc43b37235c29c2caf1e5fafec864b49 (patch) | |
tree | 004a272ae750f7778b56f2513723db28d62f3bd9 /tests | |
parent | f7af9fb63244b114653c157d3eef3e6c64f3196a (diff) |
Cocoa: Make sure modal windows get correct geometry on show
beginModalSessionForWindow will center the window and ignore
the set geometry. So to workaround this it checks the new value
against the old one and moves it back if need be.
Change-Id: I38bc74c04138992f2e0570fca666414025aeeba8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 589f3e66e1..868288e36e 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -92,6 +92,7 @@ private slots: void modalDialogClosingOneOfTwoModal(); void modalWithChildWindow(); void modalWindowModallity(); + void modalWindowPosition(); void initTestCase() { @@ -1429,6 +1430,18 @@ void tst_QWindow::modalWindowModallity() } +void tst_QWindow::modalWindowPosition() +{ + QWindow window; + window.setGeometry(QRect(100, 100, 400, 400)); + // Allow for any potential resizing due to constraints + QRect origGeo = window.geometry(); + window.setModality(Qt::WindowModal); + window.show(); + QVERIFY(QTest::qWaitForWindowExposed(&window)); + QCOMPARE(window.geometry(), origGeo); +} + #include <tst_qwindow.moc> QTEST_MAIN(tst_QWindow) |