PDA

View Full Version : QMainWindow::x(), y(), move(int, int)



fear
7th July 2007, 22:39
I save x and y properties to conf file in main window's destructor. Constructor restores these values from conf file and runs move(int, int) but every time I close and run my app, main window appears a little lower (y property higher). How can I fix this wicked behaviour? Maybe it's something with title bar but I still don't know how to fix this. Values are correctly restored from conf file.

jpn
7th July 2007, 22:52
I suggest using QWidget::saveGeometry() and QWidget::restoreGeometry(). This does not only take window geometry but also certain window states like "maximized" into account.

fear
7th July 2007, 23:10
Question is related to Qt 3.

jpn
7th July 2007, 23:49
Question is related to Qt 3.
Oops, sorry I missed that. :)

fear
8th July 2007, 00:46
It looks strange because I also tried geometry().y() and setGeometry() to restore and it didn't help :(