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. Is possible to have a widget that doesnt scroll in a QScrollArea?
Forum Updated to NodeBB v4.3 + New Features

Is possible to have a widget that doesnt scroll in a QScrollArea?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 185 Views 2 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.
  • Y Offline
    Y Offline
    Ylvy
    wrote on last edited by Ylvy
    #1

    Given this example:

    Suppose A and B are QWidgets
    designer_dEUJfPmxui.png

    Is it possible to keep everything starting from B static when the QScrollArea widget is scrolled?

    The QScrollArea occupies the entire GUI, B is inside it to let the vertical ScrollBar closer to the right border of the GUI, or it would look like this:

    1fc36ead-1b65-4f0f-8f9a-95c08eb5881f-image.png

    What I can do in this case?

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      yes, but it's not easy. One way is to trigger a move() of the static widget any time the scroll region changes.

      The other way involves layered layout managers, and transparency.

      1 Reply Last reply
      0
      • jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by jeremy_k
        #3

        Place a separate QScrollBar on the right side. Register it via QAbstractScrollArea::setVerticalScrollBar().

        Asking a question about code? http://eel.is/iso-c++/testcase/

        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