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. How do I implement multi-column spanning horizontal headings with QTableView?
Forum Updated to NodeBB v4.3 + New Features

How do I implement multi-column spanning horizontal headings with QTableView?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k 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.
  • A Offline
    A Offline
    aknudsen
    wrote on last edited by
    #1

    Hi guys

    I need to implement a sortable table where the horizontal header has each header item span two columns, entailing that when a header item is clicked the two corresponding columns must be sorted together. How can I do this? I've implemented the suggested QHeaderView variation in the [url=http://qt-project.org/faq/answer/how_can_i_span_the_headers_in_my_qtableview]FAQ[/url], but the resulting header items don't participate in sorting, i.e., clicking them does not cause any sorting to occur. Also, the horizontal header isn't correctly offset from the left, and does not display my custom headings either (just the generic 1, 2, 3...).

    Below is a screenshot of the multi-column span header, you should be able to see that the horizontal offset is wrong and that the horizontal headings are generic (1, 2, 3):

    !http://i.stack.imgur.com/ndx0g.png(Screenshot)!

    For the full code (in Python), see my [url=http://stackoverflow.com/questions/23869973/why-isnt-my-custom-horizontal-qheaderview-offset-from-the-left-and-why-wont-it]StackOverflow question[/url].

    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