Results 1 to 2 of 2

Thread: [QTabWidget] parenting (solved)

  1. #1
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default [QTabWidget] parenting (solved)

    Hi
    method removeTab is documented with the sentence
    Does not delete the page widget
    I am wondering about which object is responsible for its deletion
    after the removal and which was before.
    I guess that after, the deletion is at developper charge
    and that before, QTabWidget was.
    Which leads to a construction of a widget that is to be inserted as a tab,
    has to be constructed with no parent. Is that right ?
    Thanks in advance.
    Last edited by lauranger; 22nd August 2006 at 15:29.

  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: [QTabWidget] parenting

    QTabWidget will reparent inserted widgets and so they will be destructed correctly upon destruction of the tab widget. But when you explicitly remove a widget at runtime, it is naturally not deleted, because some users might just want to move the widget to another layout or so. So when you want to delete the removed a widget at runtime, you will first have to acquire a pointer to the widget and delete it manually afterwards removal (unless you reparent the widget so that it will get destructed by it's parent later..)
    J-P Nurmi

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

    lauranger (22nd August 2006)

Similar Threads

  1. Parenting QWindow...
    By roomie in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2006, 09:06

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.