|  | Home · Overviews · Examples

# QInputContext Class Reference
[com.trolltech.qt.gui module]

The `QInputContext` class abstracts the input method dependent data and composing state. More...

Inherits `QObject`.

## Detailed Description

The `QInputContext` class abstracts the input method dependent data and composing state.

An input method is responsible to input complex text that cannot be inputted via simple keymap. It converts a sequence of input events (typically key events) into a text string through the input method specific converting process. The class of the processes are widely ranging from simple finite state machine to complex text translator that pools a whole paragraph of a text with text editing capability to perform grammar and semantic analysis.

To abstract such different input method specific intermediate information, Qt offers the `QInputContext` as base class. The concept is well known as 'input context' in the input method domain. an input context is created for a text widget in response to a demand. It is ensured that an input context is prepared for an input method before input to a text widget.

Multiple input contexts that is belonging to a single input method may concurrently coexist. Suppose multi-window text editor. Each text widget of window A and B holds different `QInputContext` instance which contains different state information such as partially composed text.

### Groups of Functions

Context | Functions
--- | ---
Receiving information | x11FilterEvent(), `filterEvent`, `mouseHandler`
Sending back composed text | `sendEvent`
State change notification | setFocusWidget(), `reset`
Context information | `identifierName`, `language`, `font`, `isComposing`

See also `QInputContextPlugin`, `QInputContextFactory`, and `QApplication::setInputContext`.