PDA

View Full Version : Get a certain item from a QTreeWidget



mace
28th August 2006, 10:26
Hi
I've got a QTreeWidget representing a list with 3 columns. The list isn't hierarchical, means all the rows are top level items.
I want my program to select/highlight a certain row in my list, for instance the 2nd one (index 1) . I'm struggeling to implement that. The method QTreeWidget::setCurrentItem would probably do that but requires a QTreeWidgetItem as a parameter, but how do I get this item that corresponds to my index.
Any help is highly appreciated.
Cheers
MaCe

jpn
28th August 2006, 10:30
QTreeWidget::topLevelItem(int index)

mace
28th August 2006, 10:35
QTreeWidget::topLevelItem(int index)

I feel a bit like a dork. Found all kind of function but some how missed the one I wanted. :o Lots of trees but no forest.

Anyway thanks a lot for the very quick response.
MaCe