Results 1 to 3 of 3

Thread: QTableWidget test if the cell or item are empty

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: QTableWidget test if the cell or item are empty

    There are no items in cells until one sets them with QTableWidget::setItem() or after user has edited them.

    Qt Code:
    1. QTableWidgetItem* item = tableWidget->item(0,0);
    2. if (!item || item->text().isEmpty())
    3. {
    4. ...
    5. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  2. The following 2 users say thank you to jpn for this useful post:

    jaca (2nd January 2008), milli (4th May 2011)

  3. #2
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    61
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14

    Default Re: QTableWidget test if the cell or item are empty


    it functioned very well
    Thanks very much.

Similar Threads

  1. Word wrapping in a QTableWidget cell
    By jcooperddtd in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2007, 03:57
  2. QTableWidget item checkable and combo?
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2006, 07:12

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.