diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-07-25 08:40:24 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-25 15:06:46 +0200 |
commit | d7e37537d4fa2127e6ec404b9f8358337f63d9b1 (patch) | |
tree | d1aca9a4f2af9baf9a9a571b4bcaa64ee711ec45 /src/widgets/kernel | |
parent | 5ec08045837a5c689487b03a828f6ac4923375f6 (diff) |
Reintroduce -geometry command line argument for X11/XCB.
Add parsing for the window geometry specification to
QGuiApplicationPrivate. Enable the argument under a different
name for the other platforms as well.
Task-number: QTBUG-27349
Change-Id: I973b2c69f5172f7d0bc983b8ba4b0d164649ef02
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 869362654c..ac649b4bdf 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7268,10 +7268,19 @@ void QWidget::setVisible(bool visible) create(); } -#if defined(Q_WS_X11) - if (windowType() == Qt::Window) - QApplicationPrivate::applyX11SpecificCommandLineArguments(this); -#endif + // Handling of the -qwindowgeometry, -geometry command line arguments + if (windowType() == Qt::Window && windowHandle()) { + static bool done = false; + if (!done) { + done = true; + const QRect oldGeometry = frameGeometry(); + const QRect geometry = QGuiApplicationPrivate::applyWindowGeometrySpecification(oldGeometry, windowHandle()); + if (oldGeometry.size() != geometry.size()) + resize(geometry.size()); + if (geometry.topLeft() != oldGeometry.topLeft()) + move(geometry.topLeft()); + } // done + } bool wasResized = testAttribute(Qt::WA_Resized); Qt::WindowStates initialWindowState = windowState(); |