summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2015-02-26 16:16:56 +0300
committerShawn Rutledge <shawn.rutledge@digia.com>2015-03-27 08:00:01 +0000
commit7baaec17edb06634f1d6235a55c7adbd112cba3e (patch)
treee6f3418f8422b4081de4dbc737b67765dff9e9f2 /src/gui/kernel/qwindow.cpp
parentc0e4f24336cb0f0c21ad6c79e3da898d974ac1ad (diff)
Fix use of the window geometry specification
Until now we applied the geometry in QWidget::setVisible() by calling QWidget::move() and QWidget::resize(). But these methods are unreliable when the window is created but not visible yet. For example, specifying the window position by "-geometry +0+0" will take no effect. Apply the geometry directly to QWindow in QWindow::setVisible(). QWidget will update its geometry after the response of the window system. Besides it allows to specify the geometry for QML applications. Task-number: QTBUG-44713 Change-Id: I9a0e110e81e569c81da802729707fec104fef887 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index ad17621f9d..6561e0f502 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -487,6 +487,13 @@ void QWindow::setVisible(bool visible)
}
if (!app_priv->forcedWindowIcon.isNull())
setIcon(app_priv->forcedWindowIcon);
+
+ // Handling of the -qwindowgeometry, -geometry command line arguments
+ static bool geometryApplied = false;
+ if (!geometryApplied) {
+ geometryApplied = true;
+ QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(this);
+ }
}
QShowEvent showEvent;