I need to display text with QLabel with the following requirements:
- Word wrapper
- Expand from small width to full width according to the length of the text, while the label takes up one line
- Always full width while label takes several lines
- Label background filled with color
I tried putting QLabel with sizePolicy (Preferred, Preferred) and QSpacerItem with sizePolicy (Expanding, Minimum) in a QHBoxLayout.

And I expect the text to not be wrapped before the right side appears.

But I realized that the text is wrapped before the right side appears.

How to prevent this unnecessary word wrap?
Reproduction Code
Note
- spacer HBox, 1 3, 2 (, , . ).
- , 2, 1.

, .