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 doesn't show more data whan table is vertically resized
QtWS25 Last Chance

QTableView doesn't show more data whan table is vertically resized

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 581 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.
  • Q Offline
    Q Offline
    Qt_User72653
    wrote on last edited by
    #1

    I'm having an issue with a QTableView not displaying more data/items when the table is vertically resized. I added a background color to both the table view and the viewport of the table, and it's showing that they're being resized properly.

    Oddly, when the widget is horizontally and vertically resized the data shows properly.

    1 Reply Last reply
    0
    • SGaistS SGaist

      And you forgot to call the base class implementation of resizeEvent ?

      Q Offline
      Q Offline
      Qt_User72653
      wrote on last edited by Qt_User72653
      #5
      This post is deleted!
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        What version of Qt are you using ?
        On what OS ?
        What kind of model do you use underneath ?
        Can you reproduce that with a minimal compilable example ?

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

          I found that overriding the resizeEvent() is what's causing the issue. I'm using the resize event to resize the columns so they take up equal widths.

          I tried manually setting a fixed height for the table (model->rowCount(...) * rowHeight(0)), but doing this disables scrolling.

          Edit: calling the base classes resizeEvent() fixes the issue.

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

            And you forgot to call the base class implementation of resizeEvent ?

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

            Q 1 Reply Last reply
            0
            • SGaistS SGaist

              And you forgot to call the base class implementation of resizeEvent ?

              Q Offline
              Q Offline
              Qt_User72653
              wrote on last edited by Qt_User72653
              #5
              This post is deleted!
              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