3

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?

Pavel
  • 1
  • 3
  • 17
  • 51

1 Answers1

8

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.

G.M.
  • 12,232
  • 2
  • 15
  • 18
  • I know that, I don't want the arrows that you click on either, I don't want them to be drawn on the form, do you know how to use style sheets to make that arrow white? – Pavel Nov 01 '16 at 08:30
  • 1
    I just found out how to remove those arrows: widgetItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicator); Now I wonder how to remove those 90 degree angles at left, looks like you can only do it with root... – Pavel Nov 01 '16 at 08:45
  • 1
    http://stackoverflow.com/questions/16018974/qtreeview-remove-decoration-expand-button-for-all-items this answers it – Pavel Nov 01 '16 at 08:52