Thanks Pekka.
Regular Expression works fine in my scenario.
________________________________________
From: Pekka Vuorela [[email protected]]
Sent: Friday, April 29, 2011 5:24 PM
To: Meraj Ahmad Ansari
Cc: [email protected]
Subject: Re: [MeeGo-dev] Validating QML TextInput’s text by using virtual
keyboard on MeeGo 1.1.80.6 OS
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.
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for
the use of the individual to whom it is addressed. It may contain privileged or
confidential information and should not be circulated or used for any purpose
other than for what it is intended. If you have received this message in error,
please notify the originator immediately. If you are not the intended
recipient, you are notified that you are strictly prohibited from using,
copying, altering, or disclosing the contents of this message. Aricent accepts
no responsibility for loss or damage arising from the use of the information
transmitted by this email including damage from virus."
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev
http://wiki.meego.com/Mailing_list_guidelines