Results 1 to 5 of 5

Thread: QMainWindow::x(), y(), move(int, int)

  1. #1
    Join Date
    Mar 2007
    Posts
    31
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default QMainWindow::x(), y(), move(int, int)

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMainWindow::x(), y(), move(int, int)

    I suggest using QWidget::saveGeometry() and QWidget::restoreGeometry(). This does not only take window geometry but also certain window states like "maximized" into account.
    J-P Nurmi

  3. #3
    Join Date
    Mar 2007
    Posts
    31
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QMainWindow::x(), y(), move(int, int)

    Question is related to Qt 3.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMainWindow::x(), y(), move(int, int)

    Quote Originally Posted by fear View Post
    Question is related to Qt 3.
    Oops, sorry I missed that.
    J-P Nurmi

  5. #5
    Join Date
    Mar 2007
    Posts
    31
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QMainWindow::x(), y(), move(int, int)

    It looks strange because I also tried geometry().y() and setGeometry() to restore and it didn't help

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.