Results 1 to 4 of 4

Thread: Delete items retrieved from QTreeWidget.takeItem

  1. #1
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question Delete items retrieved from QTreeWidget.takeItem

    Hello again,
    Somewhere I read that you need to delete the QTreeWidgetItems that are returned from the QTreeWidget.takeChildren (or takeChild).

    Is that true?
    - Bruce

  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: Delete items retrieved from QTreeWidget.takeItem

    Quote Originally Posted by bruccutler View Post
    Somewhere I read that you need to delete the QTreeWidgetItems that are returned from the QTreeWidget.takeChildren (or takeChild).

    Is that true?
    Hi

    I can't find it from the docs either. But that's true. QTreeWidget is no more responsible for items "taken" out of it so you must delete them by hand.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question Re: Delete items retrieved from QTreeWidget.takeItem

    So, do I use a Qt call to delete the object? If so, which one?
    - BRC

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Delete items retrieved from QTreeWidget.takeItem

    No, you use a C++ call called "delete"

  5. The following user says thank you to wysota for this useful post:

    bruccutler (22nd March 2007)

Similar Threads

  1. When is the best time to delete a QCanvasItem
    By irudkin in forum Qt Programming
    Replies: 12
    Last Post: 8th March 2007, 21:28
  2. Removing items properly from qtreewidget item
    By Djony in forum Qt Programming
    Replies: 6
    Last Post: 21st November 2006, 12:20
  3. c++, placement delete upon exception
    By stinos in forum General Programming
    Replies: 6
    Last Post: 31st October 2006, 15:38
  4. delete items from list box
    By vvbkumar in forum Qt Programming
    Replies: 4
    Last Post: 23rd June 2006, 19:08
  5. Selective highlighting of Items
    By Kapil in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2006, 12:20

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.