Results 1 to 2 of 2

Thread: Tree structure

  1. #1
    Join Date
    Aug 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Tree structure

    Hi, I'm newish to Qt and I have a question about tree structures. I want to build a tree structure like in the model/view introduction on the Qt site:


    I want each row to have multiple items in it. I pretty much want the view to look like what is in the picture. However, when I try various methods to add child items (append and insert methods), it makes each child of an item appear below the parent in its own row like this:


    edit: Or, some debug output says there are 3 columns, but only one child item is displayed.

    I'm currently using a QAbstractItemModel with QStandardItems in a QTreeView. Any suggestions? Or is this not possible to show with a QTreeView?
    Last edited by ikm; 7th August 2009 at 18:18.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tree structure

    Take a look at the Editable Tree Model example.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Create Tree Structure
    By bismitapadhy in forum Qt Programming
    Replies: 4
    Last Post: 4th June 2009, 10:13
  2. Treeview Structure
    By bismitapadhy in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2009, 13:44
  3. Preserving structure in QTreeView drag and drop
    By Tito Serenti in forum Qt Programming
    Replies: 1
    Last Post: 14th February 2009, 03:39
  4. creating a Tree
    By mickey in forum General Programming
    Replies: 0
    Last Post: 20th April 2008, 17:57
  5. Optimizing filterAcceptsRow() to filter a tree
    By vfernandez in forum Qt Programming
    Replies: 1
    Last Post: 4th January 2007, 12:50

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.