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. QVBoxLayout inside a QScrollArea Issues
Forum Updated to NodeBB v4.3 + New Features

QVBoxLayout inside a QScrollArea Issues

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.0k 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.
  • K Offline
    K Offline
    kloveridge
    wrote on last edited by
    #1

    I have a panel that I want to fill with widgets. But it will most likely overflow the panel size. So it makes sense to make the panel scroll if the content overflows.

    I set up a QScrollArea and put a QVBoxLayout inside of it. I am finding that the QVBoxLayout restricts the size of the content. Here's the my form looks like QT designer:

    !http://i.imgur.com/RS8YHvt.png()!

    And here is what the program looks like running:

    !http://i.imgur.com/fPr4k2A.png()!

    Now, I can go in and hand modify the QVBoxLayout in designer and make it bigger and it works. But this feels like a hack. There's gotta be a way for the QVBoxLayout to automatically expand. I tried turning a lot dials everywhere and nothing seems affect this. What am I missing?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DBoosalis
      wrote on last edited by
      #2

      Hard to say without seeing the code, but the problem may be that what is holding vbox is not resizing. Looks like you need a GridLayout for the main area you show. You then need to make sure the row/column that holds the widget you want to grow is scaling by setting the row /col stretch values to 1 or more. If you want that row to receive all the stretch then set the other row stretch values to 0

      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