I'm currently building a UI where I do have 3 labels that are arranged in a horizontal layout:
| textLabel | valueLabel | unitLabel |
The valueLabel
and unitLabel
are aligned right. unitLabel
has a fixed width, valueLabel
's width is variable and depends on the text length inside it. textLabel
is aligned left and fills the remaining horizontal space right up to the valueLabel
.
So, in other words, the textLabel
's width is not fixed but depends on the width of valueLabel
.
My problem: when the text inside textLabel
gets too long, it overlays the valueLabel
.
Ist there a way to hide or cut off the overlapping text? I think of something like the overflow: hidden
attribute in CSS that you can set for a <div>
, or something similar. I also tried to make use of a QLineEdit as a workaraound, but it seems that there is no way to make the QLineEdit background transparent. How can I resolve this issue? Thanks in advance!