Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
4.7.0
-
None
-
Mac OS X 10.6.4; Ubuntu 10.04
Description
The documentation for QSettings explains how to restore the position and size of a window in the section "Restoring the State of a GUI Application." It also recommends the Application example to see how this works.
This example does not work on Mac OS X and X11 (at least, not Ubuntu 10.04.) If you run the example, the screen slowly creeps up on the Mac and creeps down on X11. It appears that the difference is the window title bar. Not surprisingly, the same technique fails on other applications. The pos()/size() => move()/resize() trick only works on Windows.
From informal testing, it looks like on X11 size() is providing the size excluding the window frame (as the documentation mentions), but resize() is setting the size of the window including the window frame (contrary to the documentation.) On Mac, pos() is including the window frame, and move() excludes it.
Some additional info I noticed which might help track down the problem: in X11 (at least, Ubuntu 10.04), if you move a window to the top of the screen and call move(pos())-which should have no effect-it will move down the screen the height of the title bar. I realize that X11 window frame issues are unreliable, but this problem should probably at least be addressed to work correctly for the most popular distribution.