pobere
5th November 2011, 09:18
Hi,
in a constructor of a class that inherits QLineEdit I have the following:
setInputMask("99:99");
QRegExp regexp("^([0-1][0-9]|[2][0-3]):([0-5][0-9])$");
QRegExpValidator *validator = new QRegExpValidator(regexp, this);
setValidator(validator);
This helps me to display and edit the time.
The validator works fine and also the input mask.The only problem is that:
the cursor can be moved at the position 5, and here is no char to change!
But we have in the mask only 5 chars, and the maximum position could be 4!
How can I get rid of such an annoying thing. :)
thanks.
in a constructor of a class that inherits QLineEdit I have the following:
setInputMask("99:99");
QRegExp regexp("^([0-1][0-9]|[2][0-3]):([0-5][0-9])$");
QRegExpValidator *validator = new QRegExpValidator(regexp, this);
setValidator(validator);
This helps me to display and edit the time.
The validator works fine and also the input mask.The only problem is that:
the cursor can be moved at the position 5, and here is no char to change!
But we have in the mask only 5 chars, and the maximum position could be 4!
How can I get rid of such an annoying thing. :)
thanks.