PDA

View Full Version : Tiny problem with input mask.



RSX
3rd April 2009, 23: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?

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

faldzip
4th April 2009, 06: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.

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