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. Resizing widget because of a scroll area

Resizing widget because of a scroll area

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

    I have a two column QTableWidget element where I add rows of data as needed. When the number of rows exceeds the length of the view area, the vertical scroll bar conveniently appears automatically (I assume through the AsNeeded property of the QScrollArea). However, the scroll bar hides part of the contents of the QTableWidget. I'd like to increase the size of the element when the scroll area appears, ideally through signals & slots, such that the scroll bar isn't hiding the data when it appears.

    I'm using QT Creator. I've looked at the documentation for the base classes and the ui_.h file to see how the QTableWidget is initialized but I'm not finding any signals for the scroll bar enabled. QScrollArea has a setResizeWidget() function but it doesn't seem that QWidgets use QScrollArea's but rather directly QScrollBar's.

    Does anyone have any suggestions?

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

      Hi,

      On possibility could be to use an event filter on the scroll bar and check for the QEvent::Show event.

      Hope it helps

      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
      1
      • M Offline
        M Offline
        mgreenish
        wrote on last edited by
        #3

        That worked!! Thanks for the suggestion!!!

        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