diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-08-25 11:08:09 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-08-27 09:43:26 (GMT) |
commit | 917d176fb49ee1cd54a57305e4d7ef1bd7ce6f34 (patch) | |
tree | 991185e86c865280b614d41a24a1c366a3b129d1 /src/gui/kernel | |
parent | bca6787b48c152110b4afb2bd389b1fb9a6032cb (diff) | |
download | Qt-917d176fb49ee1cd54a57305e4d7ef1bd7ce6f34.zip Qt-917d176fb49ee1cd54a57305e4d7ef1bd7ce6f34.tar.gz Qt-917d176fb49ee1cd54a57305e4d7ef1bd7ce6f34.tar.bz2 |
Implement IME reconversion on windows.
Windows IME supports reconversion of text. e.g. On a Japanese layout,
up on pressing the HENKAN key a list of choices for the current word are
shown in a popup. This patch adds that support to Qt. We will select the
current word in the widget and the choices are shown as in the editing
mode.
Task-number:225588
Reviewed-by: axis
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_win.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 76a3b1e..b92bf03 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -171,6 +171,10 @@ typedef struct tagTOUCHINPUT #include <mywinsock.h> #endif +#ifndef IMR_CONFIRMRECONVERTSTRING +#define IMR_CONFIRMRECONVERTSTRING 0x0005 +#endif + QT_BEGIN_NAMESPACE #ifdef Q_WS_WINCE @@ -2263,7 +2267,26 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam } break; } - + case WM_IME_REQUEST: { + QWidget *fw = QApplication::focusWidget(); + QWinInputContext *im = fw ? qobject_cast<QWinInputContext *>(fw->inputContext()) : 0; + if (fw && im) { + if(wParam == IMR_RECONVERTSTRING) { + int ret = im->reconvertString((RECONVERTSTRING *)lParam); + if (ret == -1) { + result = false; + } else { + return ret; + } + } else if (wParam == IMR_CONFIRMRECONVERTSTRING) { + RETURN(TRUE); + } else { + // in all other cases, call DefWindowProc() + result = false; + } + } + break; + } #ifndef Q_WS_WINCE case WM_CHANGECBCHAIN: case WM_DRAWCLIPBOARD: |