Closed MosGeo closed 12 months ago
hey @MosGeo 👋
I think this is because widgets adopt the size policy of their "largest" children if not otherwise set. In your code, if you set
collapsible_bad.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum)
... I think it should fix it.
If you try that and determine that it works, and if there don't seem to be any unfortunate side effects of that (depending on what kind of widgets are inside the collapsible) then we might want to set that by default?
@tlambert03 Thanks! Yes, with this setting, it is now working as expected. I've tested it with multiple controls and layouts inside. It would make sense to have this as the default as this is the normal "expectation" of any control (to only take the space that it is using).
Describe the bug I am seeing a lot of empty space below the QCollabsible for some reason. Sometimes, this depends on what is inside the Qcollabsible. Is this by design?
To Reproduce
Expected behavior I would have expected to the space to be minimum between the two widgets in the example above.
Desktop (please complete the following information):