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::InputMode> inputModes(const QString &locale) = 0
virtual bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) = 0
virtual QList<QVirtualKeyboardInputEngine::PatternRecognitionMode> patternRecognitionModes() const
virtual bool reselect(int cursorPosition, const QVirtualKeyboardInputEngine::ReselectFlags &reselectFlags)
virtual QVariant selectionListData(QVirtualKeyboardSelectionListModel::Type type, int index, QVirtualKeyboardSelectionListModel::Role role)
virtual int selectionListItemCount(QVirtualKeyboardSelectionListModel::Type type)
virtual void selectionListItemSelected(QVirtualKeyboardSelectionListModel::Type type, int index)
virtual bool selectionListRemoveItem(QVirtualKeyboardSelectionListModel::Type type, int index)
virtual QList<QVirtualKeyboardSelectionListModel::Type> selectionLists()
virtual bool setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) = 0
virtual bool setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) = 0
virtual QVirtualKeyboardTrace *traceBegin(int traceId, QVirtualKeyboardInputEngine::PatternRecognitionMode patternRecognitionMode, const QVariantMap &traceCaptureDeviceInfo, const QVariantMap &traceScreenInfo)
virtual bool traceEnd(QVirtualKeyboardTrace *trace)
  • 31 public functions inherited from QObject

Public Slots

virtual void reset()
virtual void update()
  • 1 public slot inherited from QObject

Signals

void selectionListActiveItemChanged(QVirtualKeyboardSelectionListModel::Type type, int index)
void selectionListChanged(QVirtualKeyboardSelectionListModel::Type type)
void selectionListsChanged()

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The base class for input methods.

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] 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.

[pure virtual] QList<QVirtualKeyboardInputEngine::InputMode> QVirtualKeyboardAbstractInputMethod::inputModes(const QString &locale)

[pure virtual] bool QVirtualKeyboardAbstractInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers)

[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 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.

[signal] void QVirtualKeyboardAbstractInputMethod::selectionListActiveItemChanged(QVirtualKeyboardSelectionListModel::Type type, int index)

[signal] void QVirtualKeyboardAbstractInputMethod::selectionListChanged(QVirtualKeyboardSelectionListModel::Type type)

[virtual] QVariant QVirtualKeyboardAbstractInputMethod::selectionListData(QVirtualKeyboardSelectionListModel::Type type, int index, QVirtualKeyboardSelectionListModel::Role role)

[virtual] int QVirtualKeyboardAbstractInputMethod::selectionListItemCount(QVirtualKeyboardSelectionListModel::Type type)

[virtual] void QVirtualKeyboardAbstractInputMethod::selectionListItemSelected(QVirtualKeyboardSelectionListModel::Type type, int index)

[virtual] bool QVirtualKeyboardAbstractInputMethod::selectionListRemoveItem(QVirtualKeyboardSelectionListModel::Type type, int index)

[virtual] QList<QVirtualKeyboardSelectionListModel::Type> QVirtualKeyboardAbstractInputMethod::selectionLists()

[signal] void QVirtualKeyboardAbstractInputMethod::selectionListsChanged()

[pure virtual] bool QVirtualKeyboardAbstractInputMethod::setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode)

[pure virtual] bool QVirtualKeyboardAbstractInputMethod::setTextCase(QVirtualKeyboardInputEngine::TextCase textCase)

[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.

[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.

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.