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. QStackedLayout and QStackedWidget always taking all available space
Qt 6.11 is out! See what's new in the release blog

QStackedLayout and QStackedWidget always taking all available space

Scheduled Pinned Locked Moved General and Desktop
qstackedlayoutsizepolicystretch
1 Posts 1 Posters 1.3k 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.
  • E Offline
    E Offline
    eduardomezencio
    wrote on last edited by
    #1

    I'm adding permanent widgets to my QMainWindow's status bar. When I add a label or some widget that I create deriving from QWidget, they only take the space needed, and that's exactly how I wanted it.
    When I tried a QStackedWidget, it would always take the entire space available. Then I tried to change it's SizePolicy to no avail. Then I tried to create a QWidget with a QStackedLayout and got the same result. I tried even to derive QStackedLayout and change some stuff and nothing..
    What do I need to do for the QStackedLayout/QStackedWidget to take only the space it needs?
    Thanks

    1 Reply Last reply
    1

    • Login

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