QVirtualKeyboardAbstractInputMethod Class
The base class for input methods. More...
Header: | #include <QVirtualKeyboardAbstractInputMethod> |
qmake: | QT += virtualkeyboard |
Inherits: | QObject |
Public Functions
QVirtualKeyboardAbstractInputMethod(QObject *parent = nullptr) | |
virtual | ~QVirtualKeyboardAbstractInputMethod() |
virtual bool | clickPreeditText(int cursorPosition) |
QVirtualKeyboardInputContext * | inputContext() const |
QVirtualKeyboardInputEngine * | inputEngine() const |
virtual QList<QVirtualKeyboardInputEngine::PatternRecognitionMode> | patternRecognitionModes() const |
virtual bool | reselect(int cursorPosition, const QVirtualKeyboardInputEngine::ReselectFlags &reselectFlags) |
virtual QVirtualKeyboardTrace * | traceBegin(int traceId, QVirtualKeyboardInputEngine::PatternRecognitionMode patternRecognitionMode, const QVariantMap &traceCaptureDeviceInfo, const QVariantMap &traceScreenInfo) |
virtual bool | traceEnd(QVirtualKeyboardTrace *trace) |
- 16 public functions inherited from QObject
Public Slots
- 1 public slot inherited from QObject
Related Non-Members
typedef | QObjectList |
Macros
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
Q_CLASSINFO(Name, Value) | |
Q_DISABLE_COPY(Class) | |
Q_DISABLE_COPY_MOVE(Class) | |
Q_DISABLE_MOVE(Class) | |
Q_EMIT | |
Q_ENUM(...) | |
Q_ENUM_NS(...) | |
Q_FLAG(...) | |
Q_FLAG_NS(...) | |
Q_GADGET | |
Q_INTERFACES(...) | |
Q_INVOKABLE | |
Q_NAMESPACE | |
Q_OBJECT | |
Q_PROPERTY(...) | |
Q_REVISION | |
Q_SET_OBJECT_NAME(Object) | |
Q_SIGNAL | |
Q_SIGNALS | |
Q_SLOT | |
Q_SLOTS |
Additional Inherited Members
- 1 property inherited from QObject
- 1 signal inherited from QObject
- 5 static public members inherited from QObject
- 8 protected functions inherited from QObject
Detailed Description
Use this class if you want to implement a custom input method using C/C++ language.
Member Function Documentation
QVirtualKeyboardAbstractInputMethod::QVirtualKeyboardAbstractInputMethod(QObject *parent = nullptr)
Constructs an input method with parent.
[virtual slot]
void QVirtualKeyboardAbstractInputMethod::reset()
This method is called by the input engine when the input method needs to be reset. The input method must reset its internal state only. The main difference to the update() method is that reset() modifies only the input method state, i.e. it must not modify the input context.
[virtual slot]
void QVirtualKeyboardAbstractInputMethod::update()
This method is called by the input engine when the input method needs to be updated. The input method must close the current pre-edit text and restore its internal state to the default.
[virtual]
QVirtualKeyboardAbstractInputMethod::~QVirtualKeyboardAbstractInputMethod()
Destroys the input method and frees all allocated resources.
[virtual]
bool QVirtualKeyboardAbstractInputMethod::clickPreeditText(int cursorPosition)
Called when the user clicks on pre-edit text at cursorPosition.
The function should return true
if it handles the event. Otherwise the input falls back to reselect() for further processing.
This function was introduced in QtQuick.VirtualKeyboard 2.4.
QVirtualKeyboardInputContext *QVirtualKeyboardAbstractInputMethod::inputContext() const
Returns the input context associated with the input method. This method returns NULL
if the input method is not active.
QVirtualKeyboardInputEngine *QVirtualKeyboardAbstractInputMethod::inputEngine() const
Returns the input engine associated with the input method. This method returns NULL
if the input method is not active.
[virtual]
QList<QVirtualKeyboardInputEngine::PatternRecognitionMode> QVirtualKeyboardAbstractInputMethod::patternRecognitionModes() const
Returns list of supported pattern recognition modes.
This method is called by the input engine to query the list of supported pattern recognition modes.
This function was introduced in QtQuick.VirtualKeyboard 2.0.
[virtual]
bool QVirtualKeyboardAbstractInputMethod::reselect(int cursorPosition, const QVirtualKeyboardInputEngine::ReselectFlags &reselectFlags)
This function attempts to reselect a word located at the cursorPosition. The reselectFlags define the rules for how the word should be selected in relation to the cursor position.
The function returns true
if the word was successfully reselected.
This function was introduced in QtQuick.VirtualKeyboard 2.0.
[virtual]
QVirtualKeyboardTrace *QVirtualKeyboardAbstractInputMethod::traceBegin(int traceId, QVirtualKeyboardInputEngine::PatternRecognitionMode patternRecognitionMode, const QVariantMap &traceCaptureDeviceInfo, const QVariantMap &traceScreenInfo)
This method is called when a trace interaction starts with the specified patternRecognitionMode. The trace is uniquely identified by the traceId. The traceCaptureDeviceInfo provides information about the source device and the traceScreenInfo provides information about the screen context.
If the input method accepts the event and wants to capture the trace input, it must return a new QVirtualKeyboardTrace object. This object must remain valid until the traceEnd() method is called. If the QVirtualKeyboardTrace is rendered on screen, it remains there until the QVirtualKeyboardTrace object is destroyed.
This function was introduced in QtQuick.VirtualKeyboard 2.0.
[virtual]
bool QVirtualKeyboardAbstractInputMethod::traceEnd(QVirtualKeyboardTrace *trace)
This method is called when the trace interaction ends. The input method should destroy the trace object at some point after this function is called. See the Trace API for Input Methods how to access the gathered data.
The method returns true
if the trace interaction is accepted.
This function was introduced in QtQuick.VirtualKeyboard 2.0.