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. Can QTreeView be used to show a tree upside-down, with children above their parents?

Can QTreeView be used to show a tree upside-down, with children above their parents?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 756 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.
  • P Offline
    P Offline
    PhilFM
    wrote on last edited by
    #1

    In our video application we want the child nodes of one of our trees to be displayed above their parent. This would cause the whole tree to be inverted. I've done a fair amount of searching but I haven't found any reference to this. I'm guessing it's possible with QTreeView but if anyone has any hints and/or example code they can share it would be appreciated.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, welcome to devnet.

      It's not possible with tree view. You can only implement a model that would populate the tree, but the whole thing, layout, the little lines indicating parenthood etc. are rigged to look like a normal top-down tree.

      You'd have to implement that widget from scratch I'm afraid. I guess you could start from a QListView and implement the collapsing and visual aids.

      Btw. I don't think I have ever seen such a construct in any software. Are you sure this will be intuitive to the user? With lots of children you'd need to scroll down just to close a tree branch. That sounds uncomfortable to use.

      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