How to pad QLineEdit with zeros for number-only entry?
Unsolved
General and Desktop
-
I am building a custom date edit using separate QLineEdit instances for month, day, year. I want to make it so each QLineEdit pads its current value with '0' (zero). I am using QIntValidator to validate the ranges.
I have set the widget mask to for example 'DD' for the month box, but this doesn't pad a single-digit month with a zero.
Anyone know how to do this?
Thanks!
-
@patrickkidd said in How to pad QLineEdit with zeros for number-only entry?:
QLineEdit
Did you try "DD;\0" for inputMask as described here: http://doc.qt.io/qt-5/qlineedit.html#inputMask-prop