Results 1 to 3 of 3

Thread: parent() heirarchy misunderstanding?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: parent() heirarchy misunderstanding?

    The parent of all subwindows in a mdi area is QMdiArea::viewport(). This is inherited from abstract scroll area.
    The viewport is a QWidget so you should write the cast accordingly.

  2. The following user says thank you to marcel for this useful post:

    KShots (16th October 2007)

  3. #2
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: parent() heirarchy misunderstanding?

    Thanks, I was able to replace that with a simple
    Qt Code:
    1. static_cast<formMainWindow *>(parent()->parent()->parent()->parent())->subWindowDestroyed(this);
    To copy to clipboard, switch view to plain text mode 
    within the closeEvent(QCloseEvent *) of the subwindow (to clean up before the thing is actually destroyed).
    Life without passion is death in disguise

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.