Results 1 to 11 of 11

Thread: On resize using Maximize Button, Dialog not appears in center of screen?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: On resize using Maximize Button, Dialog not appears in center of screen?

    Nobody is there to solve my problem.

    Its very urgent, Pls help.
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: On resize using Maximize Button, Dialog not appears in center of screen?

    Qt Code:
    1. QDlg::QDlg(QWidget *parent):QDialog(NULL)
    2. {
    3. setupUi(this);
    4. OnInit();
    5. }
    To copy to clipboard, switch view to plain text mode 

    you are saving the geometry in OnInit() but you call OnInit() during construction time, during that time the geometry is not defined.
    You have to save the geometry after the dialog is visible, best as a reaction to resizing or moving.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    merry (26th August 2011)

  4. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: On resize using Maximize Button, Dialog not appears in center of screen?

    Thanks a ton high_flyer, its working.
    Always Believe in Urself
    Merry

Similar Threads

  1. Replies: 1
    Last Post: 23rd February 2010, 08:29
  2. Center dialog on screen problems
    By lalesculiviu in forum Qt Programming
    Replies: 1
    Last Post: 1st November 2009, 13:15
  3. 'resize/maximize' button not visible
    By sindhumol_s in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2009, 02:15
  4. how to put a dialog in the center of the screen
    By biswajithit in forum Qt Programming
    Replies: 4
    Last Post: 4th September 2008, 12:24
  5. Show dialog in screen center
    By mourad in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2008, 13:41

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
  •  
Qt is a trademark of The Qt Company.