[Closed] QStandardItem - parent-child with multiple columns
-
Hi All,
I am trying to get the out put which resembles QDireFileModel like below diagram
how to get this, please help me.@
class MyClass:
name="A"
lName="B"I tried :
parent= QStandardItem("parent1")
model.appendRow(parent)
for index in range(10):
myobj=MyClass()
child= QStandardItem(myobj.name)
parent.setChild(index,1,myobj)child= QStandardItem(myobj.lName) parent.setChild(index,2,myobj)
col-0 col-1 col-2 col-3 col-N
-Parent-1
-child1 ..... ..... .......
-child2 ..... ..... .......
-child3 ..... ..... .......
......... .... ..... ......
-child-N .... ..... ......
-Parent-2
-child1 ..... ..... .......
-child2 ..... ..... .......
-child3 ..... ..... .......
......... .... ..... ......
-child-N .... ..... ......
-child-N .... ..... ......
@ -
Have a look at this "learning material":http://qt.nokia.com/learning/online/training/specialized-elearning/modelview2/model-view-ii-custom-tree-model.
There is source code too.
-
You "already":http://developer.qt.nokia.com/forums/viewthread/10461/ asked that question. Please do not double post. I am closing this topic.