Reply
Thread Tools
hopbeat's Avatar
Posts: 516 | Thanked: 643 times | Joined on Oct 2009 @ Denmark/Poland
#1
Is there any way to for QLineEdit in Maemo 5 not to capitalize the first letter? It even ignores the global capitalization setting.

The description given here is either heavily outdated or simply incorrect (there is no QInputContext::setInputMode method).
__________________
Hi! I'm a Maemo Greeter!
Witaj na talk.maemo.org!

Useful links for newcomers:
Użyteczne linki:
Nowi użyktownicy mówią cześć | New members say hello , Tu zaczynają nowi użytkownicy | New users start here, Podforum społeczności | Community subforum, Wiki dla początkujących | Beginners' wiki page, Maemo5 101, Często zadawane pytania | Frequently Asked Questions (FAQ), Google

Jeżeli mogę w czymś pomóc, pytaj!
If I can help with anything else, just ask!

Bored? Follow me
 
Posts: 263 | Thanked: 679 times | Joined on Apr 2008 @ Lyon, France
#2
See http://bugreports.qt.nokia.com/browse/QTBUG-7679

"A QLineEdit with echoMode set to QLineEdit::Password does still capitalize the first character that is entered. Additiionally, the user has no way of realizing this since the entered characters are not shown briefly before being replaced with *."

(I notice that you don't set echo mode to Password yet, but this seems related)

The QLineEdit API docs here: http://doc.trolltech.com/4.5/qlineedit.html

They don't mention capitalization of initials.

Looking through the docs of related classes doesn't mention it either.

And there's a good reason, because when I try the "lineedit" example from the Qt sources on my desktop, no capital!!! It's a Maemo specific thing.

http://wiki.maemo.org/Qt (formerly qt4.garage.maemo.org) and http://wiki.maemo.org/Qt4Hildon#Over..._Maemo_changes might give some more hints on getting rid of capitalization for a Qt input field - there's a property you need to set for a Hildon text entry.

In fact, unless I'm mistaken, the answer is right there in that last page, in the "Input method" box:

Input Method:
Maemo Qt uses the Hildon IM as default Input method.
Each kind of widget can set the IM mode. This allows the input method to focus on the type of input that the application is expecting.

...snip...

A developer can change it by using:
void QInputContext::setInputMode(int mode);

...snip...

HILDON_GTK_INPUT_MODE_AUTOCAP automatically capitalize the first letter at the start of a sentence.

...snip...

Example:
For a password field we need to set a specific IM mode:
int mode = HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE
QInputContext *qic = widget->inputContext();
qic->setInputMode(mode);

So in your case:
QLineEdit widget = new QLineEdit();
int mode = HILDON_GTK_INPUT_MODE_FULL;
QInputContext *qic = widget->inputContext();
qic->setInputMode(mode);
widget.setEchoMode(QLineEdit::Password);

And I hope that setting echomode doesn't reset setting the input context...

Let me know if this works, I'l not at all certain of myself

Dave.
widget.set
 
Posts: 87 | Thanked: 13 times | Joined on Dec 2009
#3
Yes it would be great to be able to disable this annoying feature.
 
hopbeat's Avatar
Posts: 516 | Thanked: 643 times | Joined on Oct 2009 @ Denmark/Poland
#4
The problem is that if you look here you won't see setInputMode (or anything similar). Also compilator complains about this.
__________________
Hi! I'm a Maemo Greeter!
Witaj na talk.maemo.org!

Useful links for newcomers:
Użyteczne linki:
Nowi użyktownicy mówią cześć | New members say hello , Tu zaczynają nowi użytkownicy | New users start here, Podforum społeczności | Community subforum, Wiki dla początkujących | Beginners' wiki page, Maemo5 101, Często zadawane pytania | Frequently Asked Questions (FAQ), Google

Jeżeli mogę w czymś pomóc, pytaj!
If I can help with anything else, just ask!

Bored? Follow me
 
Posts: 263 | Thanked: 679 times | Joined on Apr 2008 @ Lyon, France
#5
Originally Posted by hopbeat View Post
The problem is that if you look here you won't see setInputMode (or anything similar). Also compilator complains about this.
I'm guessing, but I imagine that Qt 4.6 won't use Hildon InputModes by default when it's final and for Maemo 6. In the meantime, this will be a bug, I guess - or perhaps the recommended version of Qt for Maemo 5 will stay Qt 4.5?

Dave.
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:16.