Hi,
I was wondering someone had ever come across the case where saveGeometry and restoreGeometry work fine on Windows and Mac OS X, but has a strange (?) behaviour on Linux (Ubuntu 10.10 at least). Basically, I have some code that saves the geometry of my application:
QSettings settings
(SETTINGS_INSTITUTION, appName
);
settings.setValue(SETTINGS_GENERAL_GEOMETRY, saveGeometry());
QSettings settings(SETTINGS_INSTITUTION, appName);
settings.setValue(SETTINGS_GENERAL_GEOMETRY, saveGeometry());
To copy to clipboard, switch view to plain text mode
and, in the same way, I have some code to retrieve it:
QSettings settings
(SETTINGS_INSTITUTION, appName
);
restoreGeometry(settings.value(SETTINGS_GENERAL_GEOMETRY).toByteArray());
QSettings settings(SETTINGS_INSTITUTION, appName);
restoreGeometry(settings.value(SETTINGS_GENERAL_GEOMETRY).toByteArray());
To copy to clipboard, switch view to plain text mode
Now, as I said above, everything works fine and as expected on Windows and Mac OS X, but for some unknown reason (to me, at least!), the Y position of the main window gets shifted every time I start my application. In fact, it gets shifted down by 29 pixels until it reaches the bottom of my screen, at which point it stays there.
I traced the Y position of my main window (using pos().y()) and was surprised to find out that it returned 53 while it should have been 24 (because of the Ubuntu bar at the top). So, yes, 53-24 gives us our (infamous) 29 pixels. I tried to autohide the Ubuntu bar at the top, just to see whether it would make a difference, but to no avail.
So... has anyone ever across that problem? If so, is there something that can be done about it?
Cheers, Alan.
Bookmarks