October 11, 2011

ManasQt ManasQt
Lab Rat
61 posts

[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.

  1. class MyClass:
  2.       name="A"
  3.       lName="B"
  4.  
  5.  I tried :
  6.          parent= QStandardItem("parent1")
  7.          model.appendRow(parent)
  8.          for index in range(10):
  9.                myobj=MyClass()
  10.                child= QStandardItem(myobj.name)
  11.                parent.setChild(index,1,myobj)
  12.            
  13.                child= QStandardItem(myobj.lName)
  14.                parent.setChild(index,2,myobj)
  15.  
  16. col-0    col-1     col-2   col-3   col-N
  17. -------------------------------------------
  18. -Parent-1
  19.          -child1    .....      .....    .......
  20.          -child2    .....      .....    .......
  21.          -child3    .....      .....    .......
  22.          .........    ....       .....    ......
  23.          -child-N   ....       .....    ......
  24. -Parent-2
  25.          -child1    .....      .....    .......
  26.          -child2    .....      .....    .......
  27.          -child3    .....      .....    .......
  28.          .........    ....       .....    ......
  29.          -child-N   ....       .....    ......
  30.          -child-N   ....       .....    ......

2 replies

October 11, 2011

Eddy Eddy
Gene Splicer
1520 posts

Have a look at this learning material [qt.nokia.com].

There is source code too.

 Signature 

Qt Certified Specialist
Nokia Qt Ambassador

October 11, 2011

Andre Andre
Robot Herder
6295 posts

You already [developer.qt.nokia.com] asked that question. Please do not double post. I am closing this topic.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

 
  ‹‹ how to access QT element from different file      QtHelp include not found ››

You must log in to post a reply. Not a member yet? Register here!