PDA

View Full Version : how can i add a text box and a combo box in tree widget?



aurora
2nd January 2012, 10:54
Hi,
Is there any possibility of adding a text box and a combo box inside a tree widget as child of the root...
If so please tell me how can i achieve that?

wysota
2nd January 2012, 11:17
Do you want just one such set or one for every item?

aurora
2nd January 2012, 11:50
Do you want just one such set or one for every item?
for every node in the tree....as a child..


AND IT SHOULD BE SOMETHING LIKE THIS..
7228

wysota
2nd January 2012, 12:05
Qt doesn't cope well with such designs. It is best to use QScrollArea, put checkable widgets (like buttons) inside and make them show or hide the boxes you want depending on their check state. Technically what you want is possible to be done directly by using persistent editors but it will be very bad performance wise.

Maledictus
3rd January 2012, 11:41
I think delegate will help you. But you should use QTreeView + custome model

aurora
3rd January 2012, 11:49
ok....can i get any example?

wysota
3rd January 2012, 15:23
I think delegate will help you. But you should use QTreeView + custome model

I wouldn't go this way. It is either a lot (and I do mean a lot) of work reimplementing widgets in the delegate or it has all the down sides of what I said earlier if done straight using persistant editors.