Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you disable expansion in QTreeWidget/QTreeView?

Tags:

qt

I just want a tree without those arrows that you click on to expand, I want everything to already be expanded and disallow expansion/unexpansion, is that possible?

like image 950
Pavel Avatar asked Dec 10 '25 19:12

Pavel


1 Answers

You can use something like...

/* Expand all items in tree */
tree_view.expandAll(true);

/* Disable interactive expand/collapse */
tree_view.setItemsExpandable(false);

That should get you what you want.

like image 92
G.M. Avatar answered Dec 12 '25 09:12

G.M.