Results 1 to 4 of 4

Thread: To Set the Position of the dialog

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

    Default To Set the Position of the dialog

    Hi all

    Working on Qt4.2 on my intel MAC

    I am working on a dialog based application , Actually what I want is when I move the dialog here and there and then when i open another dialog that dialog should appear over it only.How Pls tell me quickly

    Its urgent.....


    Thanx
    Always Believe in Urself
    Merry

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

    Default Re: To Set the Position of the dialog

    How Pls tell me quickly

    Its urgent.....
    I could never understand this appendage to posts...
    What does it imply, that we read the post, and do: "mmm... I'll first wait a couple of hours before I'll post my answer to this one..."??

    have a look at QWidget::setGeometry()
    and QWidget::move()
    ==========================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. #3
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    17
    Thanked 7 Times in 4 Posts

    Default Re: To Set the Position of the dialog

    This may be too late but I do this to move a dialog directly underneath another dialog:

    Qt Code:
    1. int resultsY = windowA->y() + windowA->frameGeometry().height();
    2. int resultsX = windowA->x();
    3. windowB->move(resultsX, resultsY);
    To copy to clipboard, switch view to plain text mode 

    You could probably just do:
    Qt Code:
    1. windowB->move(windowA->x(), windowA->y());
    To copy to clipboard, switch view to plain text mode 

    to move it over the current dialog starting at the top left corner

    It sounds like you have done this already but if anyone else is trying it, make sure you have down a show() on the dialogs first so that they are at their final position/size before moving them.

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

    Default Re: To Set the Position of the dialog

    Let me add to that, that a QDialog with a parent is automatically centered on top of the parent's top-level widget.
    J-P Nurmi

Similar Threads

  1. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  2. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  3. Initial Dialog Position
    By nleverin in forum Newbie
    Replies: 1
    Last Post: 15th July 2007, 10:19
  4. Replies: 3
    Last Post: 23rd July 2006, 18:02
  5. Dialog positioning in GNOME
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2006, 09: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.