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. Add ScrollArea to layoutless UI without breaking complex widget arrangement

Add ScrollArea to layoutless UI without breaking complex widget arrangement

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

    My UI is clicked together in QtCreator's designer. Up to now, I did not work with layouts here (long time since, I normally use QML). Of course, my UI is unusable if the screen is too small, hence I'd like to have it all in a QScrollArea.

    I've managed to drag everything into such a QScrollArea, but it shows no scroll bars. I've read that I have to use layouts for this to work. (Actually I'am using a GridLayout on my centralWidget now to have the ScrollArea be sized properly). Still no ScrollBars.

    But even if I set every single widget's size policy on fixed/fixed - when I apply a layout to the scrollAreaContents widget, my widget arrangement goes bonkers.

    Before choosing a layout:

    0_1528062669620_1st.png

    After choosing GridLayout for my scrollArea:

    0_1528062703936_2nd.png

    I have tried to move all contents of the scrollAreaContentWidget to an additional layoutless QWidget as a kind of container, but I quite frankly didn't manage to do so (I am a noob to design mode), I can create the Widget as a child of scrollArea, but I don't succeed in dragging everything else in it.

    Any ideas?

    SeDiS 1 Reply Last reply
    0
    • SeDiS SeDi

      My UI is clicked together in QtCreator's designer. Up to now, I did not work with layouts here (long time since, I normally use QML). Of course, my UI is unusable if the screen is too small, hence I'd like to have it all in a QScrollArea.

      I've managed to drag everything into such a QScrollArea, but it shows no scroll bars. I've read that I have to use layouts for this to work. (Actually I'am using a GridLayout on my centralWidget now to have the ScrollArea be sized properly). Still no ScrollBars.

      But even if I set every single widget's size policy on fixed/fixed - when I apply a layout to the scrollAreaContents widget, my widget arrangement goes bonkers.

      Before choosing a layout:

      0_1528062669620_1st.png

      After choosing GridLayout for my scrollArea:

      0_1528062703936_2nd.png

      I have tried to move all contents of the scrollAreaContentWidget to an additional layoutless QWidget as a kind of container, but I quite frankly didn't manage to do so (I am a noob to design mode), I can create the Widget as a child of scrollArea, but I don't succeed in dragging everything else in it.

      Any ideas?

      SeDiS Offline
      SeDiS Offline
      SeDi
      wrote on last edited by
      #2

      Solved by finally managing to bring a "container" widget into place.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved