PDA

View Full Version : QTreeView and multi-select of rows



QPlace
27th October 2008, 03:17
I have built slightly modified example of TreeView in QT4.5 technology preview. Modification did not change any classes, just internal data of treeview item class. I populated the model with 4 items that look like that;

Item1

|

Item2
Item 3
Item 4

where Item 1, Item3 and Item 4 are childs of "root" item and Item 2 is a child item of Item1.
Now, when I am selecting Item 3 or Item 4 treeview behavies normally, which is that previously selected item is unselected and newly selected item is highlighted.
However, when I select Item1 or Item2 _both_ of them become selected.

Selection properties of TreeView appears to be set to allow single selection only.

My question is: How to make items and their child items selected as individual rows?

QPlace
27th October 2008, 03:32
I apologize for posting. My bad - the problem was in the parent-child relationship.