QValidator, more than one in a one QLineEdit
-
Hi everybody. I need to accept a string formatted like this:
E12:34,2a
where
- the first charter (E) can be E or U
- a time value (12:34)
- an alphanumeric value (2a)
Is possible or have I to split in 3 QLineEdit objects?
-
Hi
you might want to take a look at
http://doc.qt.io/qt-5/qregularexpressionvalidator.htmlHTH
-
My rule is
([I,O]| )([0-2]| )([0-9]| ):([0-5]| )([0-9]| )
to have for example
I08:00 or O18:30
Is there a way to have it in uppercase?
08:00 and 18:30 are times fields. Is there a way to force value from 00 to 23? Now I can write 25 for example.Regards.
-
Hi,
([0-1][0-9]|2[0-3])
for the 00 to 23 -
Another option may be subclassing validator.
-
Perfetc, and to have uppercase? I need only I or O and not i o.
Is there a way to have replace mode instead of insert mode in the qlineedit? I need to rewrite without select or delete.
1/7