PDA

View Full Version : How can I set the keyboard input mode?



Santiago
14th November 2011, 13:15
Hi All,

I have a QLineEdit widget and I want to set the keyboard input mode to only numbers, using a Windows Std device. Is there a way to do this with some Qt method, or do I have to use the following Windows function:


SHSetImeMode(effectiveWinId(), SHIME_MODE_NUMBERS);


Thanks!

cincirin
14th November 2011, 13:35
QIntValidator (http://doc.qt.nokia.com/latest/qintvalidator.html)

Lykurg
14th November 2011, 13:44
For a simple check you can also use QLineEdit::inputMask

Santiago
15th November 2011, 13:21
Thanks for your responses Guys!

The thing is that I'm working with a Windows Std mobile device, so instead of verifying the string that the user has entered, I'd need to set the keyboard input mode for certain QLineEdit widgets. I mean, switch it from alphabetical or dictionary mode to numbers only mode when they got focused. That's why I was thinking about the SHSetImeMode Windows method. Is this correct or there is another way to set the keyboard input mode?

Thanks a lot again!