Comment 2 for bug 1324296

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

So the underlying problem here is that words in preedit don't get committed when buttons are pressed unless the app explicitly calls Qt.inputMethod.commit(). This wouldn't be noticed with other keyboard layouts as they don't use their predictive modes in the wifi password prompt, however the pinyin keyboard always uses this mode as it's the only method by which pinyin characters can be entered.

I'm not sure this can be reliably solved in the keyboard. Handling the committing in the keyboard on focus changes seems problematic, since often the text field might be getting processed or destroyed by something the button press is doing simultaneously, so the button really needs to explicitly ask for the text to be committed before it does anything else.

The most general solution would be for Qt.inputMethod.commit() to be called by default by AbstractButton, this requires some more discussion with the SDK team though; I've opened the following bug to track the state of this: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1324955

In the mean time any apps encountering this can fix the issue themselves by running "Qt.inputMethod.commit()" in their own onPressed methods.