PDA

View Full Version : traversing tree using mouse clicks



krishna.bv
21st December 2006, 11:34
Hi I am very much new to Qt frame. one reason i need to program in Qt is due to project requirements :( and the other is due to my love for open source movement :)

presently i need to show some data in a tree view. i used the simple tree model example code. i work on solaris 10.
but the project requirement demands the tree traversal using mouse clicks.
i will be great full if some body can send some code snippets which i can plug into the main stream with minor tweakings. thanks in advance.

also i want to know how is there any function to give intelligence for the fetching the model index of its level?

regards,
krishna.

wysota
21st December 2006, 12:55
What do you mean by "traversal using mouse clicks"?

And what kind of intelligence do you mean? Could you provide more details?

krishna.bv
22nd December 2006, 05:40
Thanks for the reply. i mean that if i double click or right click on any one of the rows how should the current row know that it has to fetch and display a particular column.

Also how to display a image before a row. i already have seen some similar query but was unable to comprehend it well.

wysota
22nd December 2006, 10:15
Thanks for the reply. i mean that if i double click or right click on any one of the rows how should the current row know that it has to fetch and display a particular column.
Connect to the doubleClicked() signal of your tree.


Also how to display a image before a row.

Set the image as the Qt::DecorationRole data piece for the item.