PDA

View Full Version : Focus problem with QLineEdit and InputMask



ttvo
25th May 2009, 16:55
I'm using Qt 4.4.3. Ihave a QLineEidt and want to setup a validator using InputMask to "000" or "00D" or "999". When the QLineEdit widget gets the focus, it will only select the first character and not everything (e.g. selectAll())

if the input field now contains "181" and you tab into it, it will select "1" and leave "81" unselected. If I remove any InputMask specifier, it will automatically select the whole content on inputfocus. Please help

wysota
25th May 2009, 19:55
But what is the problem? You want everything to be selected? I think this is natural that with an input mask only one character at a time is selected. Do you need the input mask? For an input of "000" you don't need an input mask, a validator will suffice. Input masks are useful if you want some additional characters in the input that you don't want to type in manually (i.e. spaces in bank account numbers or phone numbers, dots in IP addresses, etc.).

ttvo
26th May 2009, 13:57
Yes, I want everything to be selected. QIntValidator is what I need. Thanks.