View Full Version : Tiny problem with input mask.

4th April 2009, 00:23
Hi, I'm trying to make so user can only put alphanumeric characters in QLineEdit. So I set the inputMask to something like "NNNNNNNNNNN;". It does work but the problem is that when I click on that QLineEdit the cursor position isn't at the position which I have set in the designer (it's set on 0). The cursor pops up in the place where I click with mouse. Moreover the cursor starts overwritting. Any help please?

4th April 2009, 01:39
Get rid of the input mask and use a regular expression validator instead.

4th April 2009, 07:48
the problem you have is exactly the way input mask works. it puts spaces which you are overwriting so when you click at somewhere else than beginning than you won't be able to type all the numbers.

4th April 2009, 19:05
Ok, thanks for replies. I guess I'll have to stick to the validators then...