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. QTableView moving header to bottom -- possible?

QTableView moving header to bottom -- possible?

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

    Is there a way to move the top header bar to the bottom of a QTableView?

    Thank you.

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

      Hi,

      AFAIK, no. What is your use case ?

      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
      • A Offline
        A Offline
        Alketi
        wrote on last edited by
        #3

        I want to use the spreadsheet as an x/y plot, so I want the horizontal header on the bottom, not the top.

        Someone elsewhere just suggested using QAbstractScrollArea::setViewportMargins() to make some space below the viewport and reimplementing resizeEvent to position the headers, but I'm still not clear how to accomplish the last part -- re-positioning the headers.

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

          Shouldn't you rather use a real plot widget like what the Qwt library offers ?

          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
          • A Offline
            A Offline
            Alketi
            wrote on last edited by
            #5

            Normally, yes absolutely. However, the plot I require is better fit to a spreadsheet -- squares filled with color, each individually selectable, with tooltips and text inside, etc.

            Qwt can be bent with a lot of custom code to do this, but a spreadsheet supports it natively.

            The downside of the spreadsheet is that in Qt there doesn't appear to be an easy way to move the header to the footer.

            Here's an example. Notice they just use a blank row & column to re-create the header (as a footer).

            !http://malcom2073.github.io/emstune/screenshots/3dtable.png(2D spreadsheet plot)!

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

              So back to your header problem. You would have to add a new QHeaderView and position/resize it by hand.

              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

              • Login

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