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. Getting the height of the horizontal scrollbar in a TableView

Getting the height of the horizontal scrollbar in a TableView

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 521 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.
  • B Offline
    B Offline
    Bert59
    wrote on last edited by
    #1

    Hi

    I would like to adjust the height of a table view to its content.
    I get the height of the header and the rows. But I also need the height of the scrollbar to calculate the final height of the table.

    You can see below that the height of the table is not correct because the height of the scollbar is missing.

    76fc672a-d374-4792-86b1-ab951e57a9e4-image.png

    I couldn't find how to retrieve the height of this scrollbar.

    Any ideas?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You can access the scrollbars with QAbstractScrollArea::horizontalScrollBar and QAbstractScrollArea::verticalScrollBar.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • B Offline
        B Offline
        Bert59
        wrote on last edited by
        #3

        Thank you

        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