diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-05 13:42:11 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-05 13:42:11 +0100 |
commit | 5e8ae03578ecd0538a774505f2f7e2fc626b0ab7 (patch) | |
tree | 3b6f704df4d55d0ed2a5a706acf785541a74a45e /src/gui/kernel/qwindow.cpp | |
parent | 7a5fea113ec6088135b0b6a0fc4297e0ef362bc5 (diff) | |
parent | be3fb9afe50361e4b35d02d28ef30851335b17b6 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
configure
qmake/generators/mac/pbuilder_pbx.cpp
src/corelib/kernel/qtimerinfo_unix.cpp
src/plugins/platforms/cocoa/qcocoabackingstore.mm
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/windows/qwindowswindow.cpp
src/plugins/platforms/xcb/qglxintegration.cpp
Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 33fd4954eb..99a54dc847 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -129,6 +129,18 @@ QT_BEGIN_NAMESPACE and can keep rendering until it isExposed() returns false. To find out when isExposed() changes, reimplement exposeEvent(). The window will always get a resize event before the first expose event. + + \section1 Initial geometry + + If the window's width and height are left uninitialized, the window will + get a reasonable default geometry from the platform window. If the position + is left uninitialized, then the platform window will allow the windowing + system to position the window. For example on X11, the window manager + usually does some kind of smart positioning to try to avoid having new + windows completely obscure existing windows. However setGeometry() + initializes both the position and the size, so if you want a fixed size but + an automatic position, you should call resize() or setWidth() and + setHeight() instead. */ /*! @@ -1125,7 +1137,7 @@ void QWindow::setY(int arg) void QWindow::setWidth(int arg) { if (width() != arg) - setGeometry(QRect(x(), y(), arg, height())); + resize(arg, height()); } /*! @@ -1135,7 +1147,7 @@ void QWindow::setWidth(int arg) void QWindow::setHeight(int arg) { if (height() != arg) - setGeometry(QRect(x(), y(), width(), arg)); + resize(width(), arg); } /*! @@ -1258,6 +1270,7 @@ void QWindow::setGeometry(int posx, int posy, int w, int h) void QWindow::setGeometry(const QRect &rect) { Q_D(QWindow); + d->positionAutomatic = false; if (rect == geometry()) return; QRect oldRect = geometry(); |