My main application window is constructed as follows:
A
QVBoxLayout
;In its upper cell there is a horizontal
QSplitter
;In its lower cell there is a
QFrame
withQHBoxLayout
.
Now, when I add widgets to either QSplitter
or QHBoxLayout
and there is no room left in them, they both stretch themselves indefinitely (and go offscreen if they can) instead of shrinking the widgets they contain. For the QHBoxLayout
part, I tried combining setSizeConstraint(QLayout::SetMaximumSize)
with various ways of setting QFrame
's width, to no avail. It still stretches uncontrollably. For the QSplitter
part, I don't even know what to begin with.
So, what is the magic (and apparently undocumented - I spent 2 hours googling) API call combo for making Qt widget containers shrink their children instead of growing themselves?