summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod/qwsinputcontext_qws.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-01 08:18:06 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-01 13:10:55 (GMT)
commitf3dbe7d3ebac51b32cf7cc227032fa87a087c682 (patch)
treee8515ca209f8d3c1ab6411bb4a8ce143f5c5b995 /src/gui/inputmethod/qwsinputcontext_qws.cpp
parent69e20859bc54b1bfd9ec1a71e034d597ab466a03 (diff)
downloadQt-f3dbe7d3ebac51b32cf7cc227032fa87a087c682.zip
Qt-f3dbe7d3ebac51b32cf7cc227032fa87a087c682.tar.gz
Qt-f3dbe7d3ebac51b32cf7cc227032fa87a087c682.tar.bz2
Improved IME handling on Windows.
QWizard sets focus on a widget when switching to a page before the widget becomes visible, which caused problems with our ime handling which didn't enable ime correctly. The fix is to refactor the code to enable ime handling whenever someone tells input context to set focus by calling QInputContext::setFocusWidget instead of relying on FocusIn/Out events and duplicating updateImeStatus calls all over Qt.. Task-number: 244604 Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/gui/inputmethod/qwsinputcontext_qws.cpp')
-rw-r--r--src/gui/inputmethod/qwsinputcontext_qws.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/inputmethod/qwsinputcontext_qws.cpp b/src/gui/inputmethod/qwsinputcontext_qws.cpp
index 46ac13d..6180c48 100644
--- a/src/gui/inputmethod/qwsinputcontext_qws.cpp
+++ b/src/gui/inputmethod/qwsinputcontext_qws.cpp
@@ -73,10 +73,17 @@ void QWSInputContext::reset()
void QWSInputContext::setFocusWidget( QWidget *w )
{
- QWidget *oldFocus = focusWidget();
+ QWidget *oldFocus = focusWidget();
if (oldFocus == w)
return;
+ if (w) {
+ QWSInputContext::updateImeStatus(w, true);
+ } else {
+ if (oldFocus)
+ QWSInputContext::updateImeStatus(oldFocus, false);
+ }
+
if (oldFocus) {
QWidget *tlw = oldFocus->window();
int winid = tlw->internalWinId();
@@ -224,7 +231,7 @@ bool QWSInputContext::translateIMEvent(QWidget *w, const QWSIMEvent *e)
Q_GUI_EXPORT void (*qt_qws_inputMethodStatusChanged)(QWidget*) = 0;
-void QInputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus)
+void QWSInputContext::updateImeStatus(QWidget *w, bool hasFocus)
{
Q_UNUSED(hasFocus);