Results 1 to 2 of 2

Thread: Check if item exists into listwidget

  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Check if item exists into listwidget

    I have an input file from where I add items into the listwidget. If the item read from the file is on the listwidget, remove it from the listwidget, if it's not, then add it to the listwidget.
    This check (if the item exists into the listwidget) is any other way to be done except a for loop?
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  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: Check if item exists into listwidget

    Assistant is your friend. Read the page on QListWidget and scan the available methods.

    QListWidget::findItems(),
    QListWidget::row(),
    and QListWidget::takeItem()

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

    hakermania (28th January 2011)

Similar Threads

  1. ListWidget item's height
    By BalaQT in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2010, 13:51
  2. Replies: 1
    Last Post: 16th May 2010, 23:40
  3. Check if a table exists in a mysql database
    By graciano in forum Qt Programming
    Replies: 8
    Last Post: 5th November 2009, 02:44
  4. Check if window with certain title exists
    By devil in forum Qt Programming
    Replies: 5
    Last Post: 21st January 2009, 14:42
  5. ListWidget positions item
    By talex in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2008, 15:16

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.