Results 1 to 9 of 9

Thread: Treeview and custom model

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Treeview and custom model

    At the moment your model is flat and you can access any item with (row, column), thus your createIndex function can be very simple. If you're intending to make a truly hierarchical model, that won't be enough, though and you will have to store more information in the QModelIndex::internalPointer(). For example you could store a pointer to the parent item.
    If you really need a hierarchical model I suggest you take look at the Simple Tree Model Example. Otherwise it will be a lot easier to go with the QAbstractTableModel as jpn suggested.
    Last edited by spud; 15th May 2007 at 13:38. Reason: spelling

Similar Threads

  1. TreeView custom model
    By steg90 in forum Newbie
    Replies: 1
    Last Post: 9th May 2007, 10:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.