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 to change QScrollArea width when vertical ScrollBar appears?
Qt 6.11 is out! See what's new in the release blog

How to change QScrollArea width when vertical ScrollBar appears?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 891 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.
  • August WienerA Offline
    August WienerA Offline
    August Wiener
    wrote on last edited by
    #1

    I have QScrollArea where widget with vertical tabbar placed. I want to increase its width when user resizes main window and vertical scrollbar apears (in order to not overlap its contents with appeared scrollbar). How can i do than? SizePolicy::expanding flag seems not helping.

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

      Hi,

      Your description is not really clear. How did you setup your widgets ?

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

      August WienerA 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Your description is not really clear. How did you setup your widgets ?

        August WienerA Offline
        August WienerA Offline
        August Wiener
        wrote on last edited by
        #3

        @SGaist I have QFrame widget placed on MainWindow with horizontal layout. On the left part of this QFrame I have QScrollArea with fixed width and vertical layout. On this layout I placed QWidget with many toolbuttons. When user resizes MainWindow and its height decreases, part of tool buttons goes to invisible part of scrollArea and scrollbar apears. I want to increase width of this scroll area when this happens, in order to not overlap its contents with appeared scrollbar.
        I've tried to set the minimum and maximum widths differing by the horizontal size of this scrollbar, and set horizontalSizePolicy :: Expanding, but it didn't help.

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

          Why not set a minimal width that matched what is needed to show the content of the scroll area ?

          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