I have a QLabel
in a QVBoxLayout
. Most of the times, it only has one line of text, but sometimes, the text can be too long to fit in one line. So I have to enable wordWrap
.
I want the label to be as (vertically) small as possible, thus I set setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum)
.
Now, if there's enough vertical space, the label is higher as it would have to be with only one line:
At the same window size and without wordWrap being enabled, the label only takes the minimum space I would like it to take:
Can this also be achieved with wordWrap being enabled and independent of the window height?