Something like below. When it’s collapsed, it’s one-line. But if you click the down button, it gets expanded to show more content. A.I. told me to use QGroupBox, but it only disabled the content, not dynamically resizing itself. I called “hide()” on all its children, but that still left an empty box below.
https://learn.microsoft.com/en-us/windows/apps/design/controls/expander