VireX
3rd April 2007, 17:58
Ok, I used QSettings to save the QPoint of where the user left the window before closing the window.
When I relaunch the program, it does remember the last location the user kept the window, but it seems to add like 20 pixels to the Y position, so if I have a window maximized, after I close the program, the next time the program will be 20 pixels above where I last saved.
I'm thinking it has something to do with my resolution. Is there a way to adjust it so, that it should stay exactly where the user saved according to their screen?
like GetSystemMetrics kinda thing in Win API.
I tried using: mapToGlobal(ptPos);
But that's not what I want, it makes it relative to the top left of widget.
I tried manually adjusting the Y, each time I call the settings. But that's usually a wrong offset, and not a good fix.
When I relaunch the program, it does remember the last location the user kept the window, but it seems to add like 20 pixels to the Y position, so if I have a window maximized, after I close the program, the next time the program will be 20 pixels above where I last saved.
I'm thinking it has something to do with my resolution. Is there a way to adjust it so, that it should stay exactly where the user saved according to their screen?
like GetSystemMetrics kinda thing in Win API.
I tried using: mapToGlobal(ptPos);
But that's not what I want, it makes it relative to the top left of widget.
I tried manually adjusting the Y, each time I call the settings. But that's usually a wrong offset, and not a good fix.