Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Closed] QStandardItem - parent-child with multiple columns
Forum Updated to NodeBB v4.3 + New Features

[Closed] QStandardItem - parent-child with multiple columns

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    ManasQt
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      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.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        You "already":http://developer.qt.nokia.com/forums/viewthread/10461/ asked that question. Please do not double post. I am closing this topic.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved