PDA

View Full Version : Check if item exists into listwidget



hakermania
26th January 2011, 21:12
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?

ChrisW67
26th January 2011, 21:54
Assistant is your friend. Read the page on QListWidget and scan the available methods.

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