1
votes

I want to get all not selected items from QTreeWidget.

I have worked on getting selected items, but i want to use not selected items as well.

Any help is appreciated!

1
There's no method to get all items as a single list, you'll have to traverse the tree manually, starting with the topLevelItem()s.Frank Osterfeld
Currently, i get all selected items, and then get parent of first selected item, and that way, i have access to all of the children,but how do i know which one is not selected?thestar
QTreeWidgetItem has a method isSelected()Frank Osterfeld

1 Answers

1
votes

Use QTreeWidgetItemIterator for iterate over the items. Details and example of using: http://qt-project.org/doc/qt-4.8/qtreewidgetitemiterator.html

Inside the loop, you can choose your actions, depending on the property isSelected

(*it)->isSelected()