Need to use QTreeWidgetItemIterator class:
//Each item in a tree, checking the text in the first column
//against a user-specified search string.
QTreeWidgetItemIterator it(treeWidget);
while (*it) {
if ((*it)->text(0) == itemText)
(*it)->setSelected(true);
++it;
}
Note: The above code is excerpted from Qt documentation.
Top comments (0)