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. Prevent the child of a QSplitter from resizing when the splitter resizes

Prevent the child of a QSplitter from resizing when the splitter resizes

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

    I have a splitter with two widgets: top and bottom.

    splitter->setOrientation(Qt::Vertical);
    splitter->setOpaqueResize(true);
    splitter->addWidget(top);
    splitter->addWidget(bottom);
    splitter->setCollapsible(0, false);
    splitter->setCollapsible(1, false);
    

    When the height of the splitter decreases, I'd like the top widget's height to decrease. If the top widget is at its minimum height, I'd like the bottom widget's height to decrease. Similarly, when the height of the splitter increases, I'd like the top widget's height to increase. If the top widget is at its maximum height, I'd like the bottom widget's height to increase.

    More concisely put, when the splitter height changes, change the top widget height if possible, otherwise change the bottom height.

    The current behaviour is that the height of both widgets change to maintain a ratio of heights (the stretch factor). This just doesn't look quite right in my situation.

    How might I achieve what I'm looking for?

    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