I have four QLabel objects which I need to be part of a QHBoxLayout, making sure the ratios are 50%, 10%, 10%, and 30%, in that order:
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
Label 1 L 2 L 3 Label 4
I tried setting the stretch factors to 5, 1, 1, and 3, but then if any of those labels would need to grow because of its text, the layout doesn't honor the ratios.
I need the text of any label to be partial (clipped) if it's too large (if it would normally make the label grow).
Any way to achieve this?
musicamante said:
Setting the horizontal size policy of labels to
QSizePolicy::Ignoredworks.Here's a demo of my own use case:
Results: