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. Hierarchical Header View

Hierarchical Header View

Scheduled Pinned Locked Moved Unsolved General and Desktop
qheaderviewqtableview
2 Posts 1 Posters 5.0k 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.
  • S Offline
    S Offline
    skebanga
    wrote on 23 May 2016, 19:50 last edited by
    #1

    I need to display hierarchical headers in a table.

    I found HierarchicalHeaderView from qt-apps.org, which works, to a degree.

    table

    The problem I'm having is that QHeaderView::saveState() and QHeaderView::restoreState(const QByteArray&) don't work, and as such, my users can't save their column widths for subsequent runs of the program.

    • Is there a better hierarchical header view / table view available?
    • Is there a way to easily implement hierarchical headers in a QTableView such that I can leverage the existing saveState / restoreState?
    • How would I go about implementing saveState / restoreState in HierarchicalHeaderView?

    For the qt-apps.org version of HierarchicalHeaderView, the source code, updated for Qt 5, can be downloaded from here

    1 Reply Last reply
    0
    • S Offline
      S Offline
      skebanga
      wrote on 24 May 2016, 13:55 last edited by skebanga
      #2

      Further investigation into the issue has revealed that HiearchicalHeaderView re-implements the header views sections, and there is no relationship between the QHeaderView notion of sections, and the HiearchicalHeaderView notion of sections.

      As a result, the following calls are available, but return incorrect data.

      QHeaderView::count() returns 0
      QHeaderView::sectionSize(int) returns 0
      QHeaderView::logicalIndex(int) returns -1
      etc...

      The upshot of this is that there is a significant amount of work required in HierarchicalHeaderView in order to make in feature complete, and that the way it is currently implemented is not symbiotic with QHeaderView

      That essentially leaves 2 questions.

      • Does an open source feature-complete hierarchical header view exist?
      • Is there a way to easily implement hierarchical headers in a QHeaderView?
      1 Reply Last reply
      0

      1/2

      23 May 2016, 19:50

      • Login

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