Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Scroll Area Refuses To Work
Qt 6.12 LTS is out! See what's new in the release blog

Scroll Area Refuses To Work

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

    Using the Designer within QT Creator I am trying to set up a simple scroll area. I have a very long grid layout that is filled with various items, and am trying to create a scroll area that contains just this layout. So far I am unable to get it to scroll.

    Literal Steps:
    Have Grid Layout(filled with items) -> Drop in new scroll area into window -> Put much larger (vertically) layout within scroll area

    I have read about people having issue when trying to code this, but I am simply using the Designer for this. I also read up on the size hint documentation affecting this but am confused as to if that is actually a problem, as I haven't messed around with it at all for this specific problem.

    Additional Info:
    I have made various other large dummy layouts to test, and the scroll area will not scroll with them either. I have even taken individual items, dropped them into the scroll area, and then moved them out of the scroll area's visible area; none of this has worked. Also, my style sheet does not do anything to scroll areas either.

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

      Hi,

      Don't put your layout in the QScrollArea, put it on a widget that you set on the QScrollArea.

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

      A 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Don't put your layout in the QScrollArea, put it on a widget that you set on the QScrollArea.

        A Offline
        A Offline
        AlexanderAlexander
        wrote on last edited by AlexanderAlexander
        #3

        @sgaist
        Thank you for the reply. To clarify, the Scroll Area aromatically comes with a QWidget child in Designer, so I have always been putting my layout in said QWidget.

        Looks just like this: Scroll Area -> Widget -> Grid Layout -> Stuff (Note: Scroll Area has no other children)

        After trying many things, simply changing the min size limits of the inner QWidget finally fixed it.

        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
        • Unsolved