Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QTreeView
QtWS25 Last Chance

QTreeView

Scheduled Pinned Locked Moved Solved Qt for Python
2 Posts 2 Posters 158 Views
  • 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.
  • H Offline
    H Offline
    hwstar
    wrote on last edited by
    #1

    I would like to know if there's a way to have different headers at different levels of a QTreeView. I have data which requires 3 columns at the first level, 6 columns at the next level, and 2 columns at the deepest level.

    Right now I have a QTreeView which looks like this:
    bom_search.png

    The number of columns seem to be fixed at 3 no matter what I do.

    If QWTreeview currenlty won't do this, I suppose that I could use a series of QtreeViews with only one level on each object, but that seems clunky to me.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      To the best of my knowledge, no. The headers are populated by the model and are usually independent of the data.
      As for the number of columns, there's no restriction. Your model is responsible for returning the appropriate number.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • H hwstar has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved