From 5d48eb8bbc43b37235c29c2caf1e5fafec864b49 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 19 May 2014 19:58:35 +0200 Subject: Cocoa: Make sure modal windows get correct geometry on show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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 QTEST_MAIN(tst_QWindow) -- cgit v1.2.3