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. QTreeView Categories
Forum Updated to NodeBB v4.3 + New Features

QTreeView Categories

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.5k 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.
  • E Offline
    E Offline
    elveatles
    wrote on last edited by
    #1

    Is it possible to divide a QTreeView into sections so that each section has a title area? Possibly collapsible? I could create multiple QTreeViews, but it would be nicer to have all the data in one model.
    It would look something like this (light blue is where the trees would go):
    !http://s13.postimg.org/61nssh9g7/tree_view_with_categories.jpg!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      QTreeView has only one call to set a header. And it is assumed that the header is in the first row. You will need to create your own custom tree view.
      If an option with multiple QTreeView is suitable for you then take a look on "QToolBox":http://qt-project.org/doc/qt-5/qtoolbox.html#details
      It has multiple collapsible widgets separated by the headers.

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

        That looks like the QML Listview.

        If you are open to use QML then have a look at the Listview docs especially the section topic has an example.
        "Link to the docs":http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#example-usage

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • E Offline
          E Offline
          elveatles
          wrote on last edited by
          #4

          Thanks, I wouldn't even know where to begin with customizing the tree view in this way. Maybe I'll just keep things simple and go with the multiple tree view option.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            elveatles
            wrote on last edited by
            #5

            Sorry Eddy, I didn't see your post when I typed my last post. I'll look into the link you posted. Thank you.

            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