PDA

View Full Version : Showing a QtreeWidget branch as selected



MrGarbage
24th January 2008, 20:54
Hi,

I have a QTreeWidget comprised of QTreeWidgetItems.
After I build the tree and collapse it I want a particular
parent node highlighted (as if user clicked on it in the tree)
as shown in the second image.

I have tried all combinations of setCurrentItem(), setselected()
etc, but none seem to have any effect.

What is the solution to this seemingly simple function?

Thanks!

Mark

wysota
25th January 2008, 00:46
QTreeWidgetItem::setSelected() should have worked just fine. Can we see the code you tried?

aamer4yu
25th January 2008, 08:56
QTreeWidgetItem::setBackground might also help you.