Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flat QTreeView items - not nested

Tags:

qt

pyqt

Does anyone know if it's possible the flatten a QTreeView/QTreeWidget while still being able to expand child items.

What the default is:

- A
  -> A1
  -> A2
- B
  -> B2
+ C

- is expanded and + is collapsed

What I would like:

- A
  A1
  A2
- B
  B2
+ C

all collapsed

+ A
+ B
+ C

A, B, C are the root items.

like image 788
Nathan W Avatar asked Jun 15 '12 02:06

Nathan W


1 Answers

MyTree -> setIndentation (0) ;
like image 194
TonyK Avatar answered Nov 04 '22 03:11

TonyK