Re: Qt question: How to automatically enable numeric input mode for a field?
use input method hints - Original Message - From: Sudheer K. Sent: 05/13/10 11:04 PM To: Maemo Dev Mailing List Subject: Qt question: How to automatically enable numeric input mode for a field? Hi, I want to create a phone number field (QLineEdit) in my configuration widget. User can enter numbers and '+' or 'p' characters in the field. The key thing is I don't want the users to use the Fn key everytime they have to edit the number. Application should automatically enable number entry and allow users to enter numbers only. Users can use Fn key to enter '+' or 'p' if needed. The expected functionality is similar to adding a new phone number for a contact in addressbook. How can I do this in Qt? Regards, Sudheer - The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt question: How to automatically enable numeric input mode for a field?
sorry my previous message was sent before I finished typing... anyways use input method hints.. http://doc.trolltech.com/4.6/qt.html#InputMethodHint-enum http://doc.trolltech.com/4.6/qt.html#InputMethodHint-enum something like this - Original Message - From: Sudheer K. Sent: 05/13/10 11:04 PM To: Maemo Dev Mailing List Subject: Qt question: How to automatically enable numeric input mode for a field? Hi, I want to create a phone number field (QLineEdit) in my configuration widget. User can enter numbers and '+' or 'p' characters in the field. The key thing is I don't want the users to use the Fn key everytime they have to edit the number. Application should automatically enable number entry and allow users to enter numbers only. Users can use Fn key to enter '+' or 'p' if needed. The expected functionality is similar to adding a new phone number for a contact in addressbook. How can I do this in Qt? Regards, Sudheer - The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt question: How to automatically enable numeric input mode for a field?
I dont know whats wrong with my mail client now, a control C just sends the message so sorry my previous message(s) were sent before I finished typing... anyways use input method hints.. http://doc.trolltech.com/4.6/qt.html#InputMethodHint-enum http://doc.trolltech.com/4.6/qt.html#InputMethodHint-enum something like this linedit-setInputMethodHints(Qt::ImhDigitsOnly); - krk969 - Original Message - From: Sudheer K. Sent: 05/13/10 11:04 PM To: Maemo Dev Mailing List Subject: Qt question: How to automatically enable numeric input mode for a field? Hi, I want to create a phone number field (QLineEdit) in my configuration widget. User can enter numbers and '+' or 'p' characters in the field. The key thing is I don't want the users to use the Fn key everytime they have to edit the number. Application should automatically enable number entry and allow users to enter numbers only. Users can use Fn key to enter '+' or 'p' if needed. The expected functionality is similar to adding a new phone number for a contact in addressbook. How can I do this in Qt? Regards, Sudheer - The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
RE: Qt question: How to automatically enable numeric input mode for a field?
Date: Fri, 14 May 2010 00:34:48 +0200 From: rkma...@gmx.com Subject: RE: Qt question: How to automatically enable numeric input mode for afield? To: scifi@hotmail.com; maemo-developers@maemo.org hi sudheer, as far as I know this is what its actually supposed to do , else it may be a bug. btw this works only in QT4.6. http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints ive tried this in a spin box and it works. - krk969 Hi Ram, Here is the code that I am using. The hint is working fine for virtual keyboard, but I am looking for a physical keyboard solution. The physical keyboard input mode should automatically change to numeric for this field. What am I missing here? lineEditCallingCardNumber = new QLineEdit(formLayoutWidget); lineEditCallingCardNumber-setObjectName(QString::fromUtf8(lineEditCallingCardNumber)); lineEditCallingCardNumber-setInputMethodHints(Qt::ImhDialableCharactersOnly); _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
RE: Qt question: How to automatically enable numeric input mode for a field?
have you tried this - Original Message - From: Sudheer K. Sent: 05/13/10 11:54 PM To: rkma...@gmx.com, Maemo Dev Mailing List Subject: RE: Qt question: How to automatically enable numeric input mode for a field? - Date: Fri, 14 May 2010 00:34:48 +0200 From: rkma...@gmx.com Subject: RE: Qt question: How to automatically enable numeric input mode for a field? To: scifi@hotmail.com; maemo-developers@maemo.org hi sudheer, as far as I know this is what its actually supposed to do , else it may be a bug. btw this works only in QT4.6. http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints ive tried this in a spin box and it works. - krk969 Hi Ram, Here is the code that I am using. The hint is working fine for virtual keyboard, but I am looking for a physical keyboard solution. The physical keyboard input mode should automatically change to numeric for this field. What am I missing here? lineEditCallingCardNumber = new QLineEdit(formLayoutWidget); lineEditCallingCardNumber-setObjectName(QString::fromUtf8(lineEditCallingCardNumber)); lineEditCallingCardNumber-setInputMethodHints(Qt::ImhDialableCharactersOnly); - Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. Learn more. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
RE: Qt question: How to automatically enable numeric input mode for a field?
have you tried this hint ? ( this worked for the spin box, I could use the hardware keyboard without pressing Fn ) Qt::ImhDigitsOnly Qt::ImhFormattedNumbersOnly didnt work for me , for the spin box , I needed a dot (.) , since I was using a double spinbox. I'll be raising a bug for that, perhaps even the hint you are using below has similar issues. WHen I spoke to some QT team members , what they told me was this should be done by default for some widgets, for example the spinbox there shouldnt be a need to explicitly hint, it should be default, so it seems there could be issues to iron out here. try using the above working hint and see how it goes. -krk969 - Original Message - From: Sudheer K. Sent: 05/13/10 11:54 PM To: rkma...@gmx.com, Maemo Dev Mailing List Subject: RE: Qt question: How to automatically enable numeric input mode for a field? - Date: Fri, 14 May 2010 00:34:48 +0200 From: rkma...@gmx.com Subject: RE: Qt question: How to automatically enable numeric input mode for a field? To: scifi@hotmail.com; maemo-developers@maemo.org hi sudheer, as far as I know this is what its actually supposed to do , else it may be a bug. btw this works only in QT4.6. http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints http://doc.trolltech.com/qt-maemo-4.6/qgraphicsitem.html#inputMethodHints ive tried this in a spin box and it works. - krk969 Hi Ram, Here is the code that I am using. The hint is working fine for virtual keyboard, but I am looking for a physical keyboard solution. The physical keyboard input mode should automatically change to numeric for this field. What am I missing here? lineEditCallingCardNumber = new QLineEdit(formLayoutWidget); lineEditCallingCardNumber-setObjectName(QString::fromUtf8(lineEditCallingCardNumber)); lineEditCallingCardNumber-setInputMethodHints(Qt::ImhDialableCharactersOnly); - Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. Learn more. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
RE: Qt question: How to automatically enable numeric input mode for a field?
Date: Fri, 14 May 2010 01:04:19 +0200 From: rkma...@gmx.com Subject: RE: Qt question: How to automatically enable numeric input mode for a field? To: scifi@hotmail.com; maemo-developers@maemo.org have you tried this hint ? ( this worked for the spin box, I could use the hardware keyboard without pressing Fn ) Qt::ImhDigitsOnly Qt::ImhFormattedNumbersOnly didnt work for me , for the spin box , I needed a dot (.) , since I was using a double spinbox. I'll be raising a bug for that, perhaps even the hint you are using below has similar issues. WHen I spoke to some QT team members , what they told me was this should be done by default for some widgets, for example the spinbox there shouldnt be a need to explicitly hint, it should be default, so it seems there could be issues to iron out here. try using the above working hint and see how it goes. -krk969 Ram, I have tried Qt::ImhDigitsOnly and it works as expected. It will switch the physical and virtual keyboard to numeric input only. I guess I will use it at this moment (I don't really need p and + characters in the field). Thanks for your help. Regards, Sudheer _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers