PyQt collapsible GroupBox or Layout

I have grown very accustomed to Maya’s collapsible frame layout functionality and having the collapse action recalculating and setting the window size. Transitioning over to Qt, I was disappointed to find that nothing seems to be collapsible in Qt land (at least not according to my Google searches).

I actually need this functionality outside of Maya as well as in Maya, so I need to find a Qt solution and not a Maya solution.

Has anyone managed to get PyQt layouts, groupBox (preferred) or any layout to collapse and give space to the UI for more controls area?

Would really appreciate any pointers.
Thanks,
/Christian

yes, We built a custom widget for this that hides the collapsed widget and when it’s unhidden it grabs the new minimum size hint and resizes the parent.

Although I didn’t use any groupBox stuff, it’s just widgets.

Key word there is size hint. Thank you very much, I think I see the light.
Still wrapping my head around qt…

If you have any other tips/hints, they are much appreciated.

Thank you,
/Christian