PDA

View Full Version : Create Tree Structure



bismitapadhy
4th June 2009, 06:04
i want to crate only onle label tree like structure. I want to expand all the item and don't want to allow to contract. As well as i dont want the tree widget header bar.
I want to create the structure as it is shown in the Qt Centre, i.e. i attached in the attachement.

e8johan
4th June 2009, 08:07
Start with a QTreeWidget or a QTreeView is you want to have model. Then start by hiding the header, and then work your way through the properties - preferably in Designer where you get immediate feedback.

hwerglmir
4th June 2009, 08:16
For making the treeview/widget more static, use:

view.setItemsExpandable(false);
view.expandAll();

For making the header invisible, use:

view.setHeaderHidden(true);

rtfm

bismitapadhy
4th June 2009, 08:37
Start with a QTreeWidget or a QTreeView is you want to have model. Then start by hiding the header, and then work your way through the properties - preferably in Designer where you get immediate feedback.I am using qtreewidget and qtreewidgetItem, created tree structure as well able to hide the header,but i am not able to disable or hide the expandable option.Tell me which setting is helpful for this. :)

hwerglmir
4th June 2009, 11:13
look one post above. "view" is your qtreewidget.


view.setItemsExpandable(false);
view.expandAll();