QWSInputMethod Class Reference
|
Constant | Value | Description |
---|---|---|
QWSInputMethod::Update | 0 | The input widget is updated in some way; use sendQuery() with Qt::ImMicroFocus as an argument for more information. |
QWSInputMethod::FocusIn | 1 | A new input widget receives focus. |
QWSInputMethod::FocusOut | 2 | The input widget loses focus. |
QWSInputMethod::Reset | 3 | The input method should be reset. |
QWSInputMethod::Destroyed | 4 | The input widget is destroyed. |
See also updateHandler().
Constructs a new input method.
Use the QWSServer::setCurrentInputMethod() function to install it.
Destroys this input method, uninstalling it if it is installed.
Filters the key input identified by the given unicode, keycode, modifiers, isPress and autoRepeat parameters.
Note that the default implementation does nothing; reimplement this function to handle input from both physical and virtual devices.
The keycode is a Qt::Key value, and the modifiers is an OR combination of Qt::KeyboardModifiers. The isPress parameter is telling whether the input is a key press or key release, and the autoRepeat parameter determines whether the input is autorepeated ( i.e., in which case the QWSKeyboardHandler::beginAutoRepeat() function has been called).
To block the event from further processing, return true when reimplementing this function; the default implementation returns false.
See also setInputResolution() and inputResolutionShift().
This is an overloaded member function, provided for convenience.
Filters the mouse input identified by the given position, state, and wheel parameters.
Returns the number of bits shifted to go from pointer resolution to screen resolution when filtering mouse input.
See also setInputResolution() and filter().
Handles mouse events within the preedit text.
Note that the default implementation resets the input method on all mouse presses; reimplement this function to alter this behavior.
The offset parameter specifies the position of the mouse event within the string, and state specifies the type of the mouse event as described by the QWSServer::IMMouse enum. If state is less than 0, the mouse event is inside the associated widget, but outside the preedit text. When clicking in a different widget, the state is QWSServer::MouseOutside.
See also sendPreeditString() and reset().
Receive replies to an input method query.
Note that the default implementation does nothing; reimplement this function to receive such replies.
Internally, an input method query is passed encapsulated by an IMQuery event generated by the sendQuery() function. The queried property and the result is passed in the property and result parameters.
See also sendQuery() and QWSServer::sendIMQuery().
Resets the state of the input method.
If the input method is in compose mode, i.e., the input method is actively composing a preedit string, the default implementation calls sendEvent() with empty preedit and commit strings; otherwise it does nothing. Reimplement this function to alter this behavior.
See also sendEvent().
Sends an event encapsulating the given commitString, to the focus widget.
Note that this will cause the input method to leave compose mode, i.e., the input method will no longer be actively composing the preedit string.
If the specified replaceLength is greater than 0, the commit string will replace the given number of characters of the receiving widget's previous text, starting at the given replaceFromPosition relative to the start of the current preedit string.
Internally, the event is represented by a QWSEvent object of the IMEvent type.
See also sendEvent() and sendPreeditString().
Sends the given event to the focus widget.
The QInputMethodEvent class is derived from QWSEvent, i.e., the given event is a QWSEvent object of the IMEvent type.
See also sendPreeditString(), sendCommitString(), and reset().
Sends a mouse event specified by the given position, state and wheel parameters.
The given position will be transformed if the screen coordinates do not match the pointer device coordinates.
Note that the event will be not be tested by the active input method, but calling the QWSServer::sendMouseEvent() function will make the current input method filter the event.
See also mouseHandler() and sendEvent().
Sends an event encapsulating the given preeditString, to the focus widget.
The specified selectionLength is the number of characters to be marked as selected (starting at the given cursorPosition). If selectionLength is negative, the text before cursorPosition is marked.
The preedit string is marked with QInputContext::PreeditFormat, and the selected part is marked with QInputContext::SelectionFormat.
Sending an input method event with a non-empty preedit string will cause the input method to enter compose mode. Sending an input method event with an empty preedit string will cause the input method to leave compose mode, i.e., the input method will no longer be actively composing the preedit string.
Internally, the event is represented by a QWSEvent object of the IMEvent type.
See also sendEvent() and sendCommitString().
Sends an input method query (internally encapsulated by a QWSEvent of the IMQuery type) for the specified property.
To receive responses to input method queries, the virtual queryResponse() function must be reimplemented.
See also queryResponse() and QWSServer::sendIMQuery().
Sets and returns the number of bits shifted to go from pointer resolution to screen resolution when filtering mouse input.
If isHigh is true and the device has a pointer device resolution twice or more of the screen resolution, the positions passed to the filter() function will be presented at the higher resolution; otherwise the resolution will be equal to that of the screen resolution.
See also inputResolutionShift() and filter().
Handles update events including resets and focus changes. The update events are specified by the given type which is one of the UpdateType enum values.
Note that reimplementations of this function must call the base implementation for all cases that it does not handle itself.
See also UpdateType.
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 qtextended4.4 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com