On Fri, 2011-04-29 at 17:18 +0530, ext Meraj Ahmad Ansari wrote:
> Hi All,
> 
> I am using QML TextInput control. I want to validate the entered text (only 
> alphanumeric is allowed)
> so i wrote code like this –
> if ( ( event.key >= Qt.Key_A ) && ( event.key <= Qt.Key_Z ) ) { 
> event.accepted = false; } else if ( ( event.key >= Qt.Key_0 ) && ( event.key 
> <= Qt.Key_9 ) ) { event.accepted = false; }
> 
> Please note my underlying OS is MeeGo 1.1.80.6 and test machine is Lenove 
> S10-3t netbook.
> This code is working fine when i am using netbook’s keyboard but when i am 
> using virtual keyboard then this code is not working.
> 
> Anybody have an idea?

Hi,

Input from virtual keyboard(s) is not based on key events, but rather
input method events (see QInputMethodEvent class).

What you want there is a validator, see "validator" property of
TextInput.


_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev
http://wiki.meego.com/Mailing_list_guidelines

Reply via email to