Results 1 to 11 of 11

Thread: QTreeView with Model-View help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTreeView with Model-View help

    Hi,

    I am trying to make a tree for my data objects, but I am having trouble figuring out how I should approach it to make it as clean as possible. I was using a QTreeWidget, but it felt very hackish and wasn't very nice to keep up with. I'd like to use a QTreeView, but I am unsure of how to handle the models. An example of how my data classes work is below.

    • data class 1
      • group
        • sub-data class 1
          • group
            • sub-sub-data class 1
      • group
      • group
    • data class 2
      • group
      • group
      • group


    At the root, there are the large data classes, then there are groups of related data classes within that (the groups keep unrelated data classes from grouping together). When a data class is added, it needs to build its subtree of data and groups. the group "labels" cant be selected, but the data classes each have a widget for editing the internal data. How should I design the model to handle this?

    --MathStuf

    Edit: Typoed QList* rather than QTree*
    Last edited by MathStuf; 21st April 2008 at 20:00.

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  2. Help with Model View
    By weepdoo in forum Qt Programming
    Replies: 13
    Last Post: 12th October 2007, 10:32
  3. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  4. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 13:01
  5. Replies: 6
    Last Post: 20th April 2006, 10:23

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.