Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QWindowsInputContext Class

Windows Input context implementation More...

 #include <QWindowsInputContext>

Inherits: QObject.

Public Functions

QWindowsInputContext()
~QWindowsInputContext()
bool composition(HWND hwnd, LPARAM lParamIn)
bool endComposition(HWND hwnd)
bool handleIME_Request(WPARAM wparam, LPARAM lparam, LRESULT * result)
int reconvertString(RECONVERTSTRING * reconv)
bool startComposition(HWND hwnd)

Reimplemented Public Functions

virtual void invokeAction(QInputMethod::Action, int cursorPosition)
virtual void reset()
virtual void update(Qt::InputMethodQueries queries)
  • 31 public functions inherited from QObject

Static Public Members

QWindowsInputContext * instance()
  • 11 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 2 signal inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

Windows Input context implementation

Handles input of foreign characters (particularly East Asian) languages.

Testing

  • Install the East Asian language support and choose Japanese (say).
  • Compile the mainwindows/mdi example and open a text window.
  • In the language bar, switch to Japanese and choose the Input method 'Hiragana'.
  • In a text editor control, type the syllable 'la'. Underlined characters show up, indicating that there is completion available. Press the Space key two times. A completion popup occurs which shows the options.

Reconversion: Input texts can be 'converted' into different input modes or more completion suggestions can be made based on context to correct errors. This is bound to the 'Conversion key' (F13-key in Japanese, which can be changed in the configuration). After writing text, pressing the key selects text and triggers a conversion popup, which shows the alternatives for the word.

Interaction

When the user activates input methods, Windows sends WM_IME_STARTCOMPOSITION, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION messages that trigger startComposition(), composition(), endComposition(), respectively. No key events are sent.

composition() determines the markup of the pre-edit or selected text and/or the final text and sends that to the focus object.

In between startComposition(), endComposition(), multiple compositions may happen (isComposing).

update() is called to synchronize the position of the candidate window with the microfocus rectangle of the focus object. Also, a hidden caret is moved along with that position, which is important for some Chinese input methods.

reset() is called to cancel a composition if the mouse is moved outside or for example some Undo/Redo operation is invoked.

Note: Mouse interaction of popups with QtWindows::InputMethodOpenCandidateWindowEvent and QtWindows::InputMethodCloseCandidateWindowEvent needs to be checked (mouse grab might interfere with candidate window).

Member Function Documentation

QWindowsInputContext::QWindowsInputContext()

QWindowsInputContext::~QWindowsInputContext()

bool QWindowsInputContext::composition(HWND hwnd, LPARAM lParamIn)

Notify focus object about markup or final text.

bool QWindowsInputContext::endComposition(HWND hwnd)

bool QWindowsInputContext::handleIME_Request(WPARAM wparam, LPARAM lparam, LRESULT * result)

QWindowsInputContext * QWindowsInputContext::instance() [static]

void QWindowsInputContext::invokeAction(QInputMethod::Action, int cursorPosition) [virtual]

int QWindowsInputContext::reconvertString(RECONVERTSTRING * reconv)

Determines the string for reconversion with selection.

This is triggered twice by WM_IME_REQUEST, first with reconv=0 to determine the length and later with a reconv struct to obtain the string with the position of the selection to be reconverted.

Obtains the text from the focus object and marks the word for selection (might not be entirely correct for Japanese).

void QWindowsInputContext::reset() [virtual]

Cancels a composition.

bool QWindowsInputContext::startComposition(HWND hwnd)

void QWindowsInputContext::update(Qt::InputMethodQueries queries) [virtual]

Moves the candidate window along with microfocus of the focus object.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web