Unit always visible in QLineEdit
I want to have a QLineEdit, where the user can input numbers.
After the number there should be always a unit shown (e.g. 'mm').
The user should not be able to delete the mm, select or do what ever with it.
The LayoutDirection is from left to right.
I thougt a simple solution can be to add another LineEdit to the first one.
And modify the style of the "unit - LineEdit" so that is looks like the two are one together.
Or is there a better solution?Maybe with inputmask something?
Re: Unit always visible in QLineEdit
You can do that with a QSpinBox and QSpinBox::setSuffix()
Re: Unit always visible in QLineEdit
That doesn't work very well, I have the layout direction right to left, but the suffix is still before the number, also when I use the prefix.
I think thats a bug.
And the other think is I don't want to limit the user in his input value, e.g. how many digits before and after the point.