I have a widget hierarchy like this, with a frame (in order to set a background color behind the buttons and label) and a horizontal layout as its direct child.
However, the horizontal layout (red frame in below screenshot of Qt Designer) does not take up the whole space inside the frame. How can I do that? Changing the property "layoutSizeConstraint" does not work. The label is already set to "Expanding" in horizontal direction, but still it keeps its size – I can resize the horizontal layout manually, but it should fill the width automatically.
Your
frame
frame doesn't have a layout (it's shown on its icon in the tree). It's because you have added newQHBoxLayout
and dragged it into a frame. You should remove this layout, drag the label and buttons to theframe
, then openframe
's context menu and choose "Layout" option and choose desired layout.