Results 1 to 2 of 2

Thread: About QTableWidget's setRowCount

  1. #1
    Join Date
    Dec 2010
    Posts
    20
    Thanks
    9
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default About QTableWidget's setRowCount

    Hi all I have a question,

    Consider I have 10 row in my QTableWidget. I put some texts in each item. Then I use

    setRowCount(0);

    With above code, did the items automatically deleted or we just lost the pointer to them? can't find about this in documentation

    Sorry for my poor english

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: About QTableWidget's setRowCount

    From QTableWidget::setItem():
    Sets the item for the given row and column to item.
    The table takes ownership of the item.
    So the table is responsible for deleting the items it contains. The same is true of widgets added to cells.

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

    rivci (10th November 2011)

Similar Threads

  1. Qtablewidget example
    By thefatladysingsopera in forum Newbie
    Replies: 2
    Last Post: 29th July 2011, 09:27
  2. Replies: 1
    Last Post: 6th January 2011, 04:19
  3. QAbstractTableModel SetRowCount problem
    By gutiory in forum Qt Programming
    Replies: 2
    Last Post: 25th November 2010, 07:48
  4. QTableWidget
    By abrou in forum Newbie
    Replies: 3
    Last Post: 25th July 2008, 19:09
  5. QTableWidget
    By chak_med in forum Qt Programming
    Replies: 1
    Last Post: 17th May 2006, 15:53

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.