PDA

View Full Version : Custom the Width/Pos of Column/Widget of Each row in QTreeView



btbt9527
5th January 2016, 18:41
If I create a QTreeView,
If it is a multi-hirarchy tree with 2 Columns
This is how it gonna look like



Column0 --------------- Column1
------------------------------
Widget0 --------------- Widget
Widget00 ----------- Widget
Widget01 ----------- Widget
Widget010 ------ Widget

Widget1 --------------- Widget
Widget10 ----------- Widget
Widget100 ------ Widget
Widget11 ----------- Widget
Widget110 ------ Widget


All the widgets in Column0 look like they are in a tree
But all the widgets in Column1 always aligned in the same line
And with the depth of the tree grows, the Column1 might block Column0

This is what I expected:



Column0 --------------- Column1
------------------------------
Widget0 --------------- Widget
Widget00 --------------- Widget
Widget01 --------------- Widget
Widget010 --------------- Widget

Widget1 --------------- Widget
Widget10 --------------- Widget
Widget100 --------------- Widget
Widget11 --------------- Widget
Widget110 --------------- Widget


Also here is a link of picture of the effect that I want:
I think that's a QTreeView,

11618

Seems like he can customize the width of the widget/column in each row.
I dont have the src code.

How did he do it?

Thanks for reading and answering my question.