Results 1 to 3 of 3

Thread: How to get the position of a QMdiSubWindow

  1. #1
    Join Date
    Oct 2009
    Location
    Vienna, Austria
    Posts
    57
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default How to get the position of a QMdiSubWindow

    I'm using a main window and create QMdiSubWindow windows in its QMdiArea.
    I cannot see how to retrieve the current geometry (position relative to the main window).
    When using frameGeometry() the position is always y=30 and x=4 that seems to be position of the client area in the window.
    What am I doing wrong?

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get the position of a QMdiSubWindow

    You can also try:
    Qt Code:
    1. mdiArea->activeSubWindow()->pos();
    To copy to clipboard, switch view to plain text mode 

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

    doberkofler (6th November 2009)

  4. #3
    Join Date
    Oct 2009
    Location
    Vienna, Austria
    Posts
    57
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get the position of a QMdiSubWindow

    Thank you very much for your help. This does work but Ido not to understand what is going on here under the hood.
    1) Why would using "mdiArea->activeSubWindow()->pos()" work and "this->pos()" in the subwindow not?
    2) Why does "this->pos()" work on a "regular" window work and on an Mdi subwindow not?
    3) In the meantime I'm also struggling with the problem that my overwritten "moveEvent(QMoveEvent*)" method in the Mdi subwindow does not seem to get invoked when changing the position of the window.

Similar Threads

  1. Replies: 7
    Last Post: 25th October 2009, 08:03
  2. QMdiSubWindow Restore Geometry
    By ChrisW67 in forum Newbie
    Replies: 1
    Last Post: 26th June 2009, 08:42
  3. Replies: 2
    Last Post: 12th June 2009, 11:55
  4. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 18:48

Tags for this Thread

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.