InputContext Class

(QtVirtualKeyboard::InputContext)

Provides access to an input context. More...

Header: #include <InputContext>
Instantiated By: InputContext
Inherits: QObject

Properties

  • 1 property inherited from QObject

Public Functions

bool anchorRectIntersectsClipRect() const
bool animating() const
bool capsLock() const
void clear()
void commit()
void commit(const QString &text, int replaceFrom = 0, int replaceLength = 0)
int cursorPosition() const
bool cursorRectIntersectsClipRect() const
QRectF cursorRectangle() const
bool focus() const
void hideInputPanel()
InputEngine *inputEngine() const
QObject *inputItem() const
Qt::InputMethodHints inputMethodHints() const
QRectF keyboardRectangle() const
QString locale() const
QString preeditText() const
QRectF previewRectangle() const
bool previewVisible() const
QString selectedText() const
bool selectionControlVisible() const
void sendKeyClick(int key, const QString &text, int modifiers = 0)
void setAnimating(bool animating)
void setCapsLock(bool enable)
void setKeyboardRectangle(QRectF rectangle)
void setLocale(const QString &locale)
void setPreeditText(const QString &text, QList<QInputMethodEvent::Attribute> attributes = QList<QInputMethodEvent::Attribute> (), int replaceFrom = 0, int replaceLength = 0)
void setPreviewRectangle(QRectF rectangle)
void setPreviewVisible(bool visible)
void setSelectionOnFocusObject(const QPointF &anchorPos, const QPointF &cursorPos)
void setShift(bool enable)
bool shift() const
ShiftHandler *shiftHandler() const
QString surroundingText() const
  • 31 public functions inherited from QObject

Signals

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Provides access to an input context.

Property Documentation

anchorRectIntersectsClipRect : const bool

Access functions:

bool anchorRectIntersectsClipRect() const

Notifier signal:

void anchorRectIntersectsClipRectChanged()

animating : bool

This property holds the animating status.

Use this property to set the animating status, for example during UI transitioning states.

Access functions:

bool animating() const
void setAnimating(bool animating)

Notifier signal:

void animatingChanged()

capsLock : bool

This property holds the caps lock status.

This property is changed when the caps lock status changes.

Access functions:

bool capsLock() const
void setCapsLock(bool enable)

Notifier signal:

void capsLockChanged()

cursorPosition : const int

This property holds the cursor position.

This property is changed when the cursor position changes.

Access functions:

int cursorPosition() const

Notifier signal:

void cursorPositionChanged()

cursorRectIntersectsClipRect : const bool

Access functions:

bool cursorRectIntersectsClipRect() const

Notifier signal:

void cursorRectIntersectsClipRectChanged()

cursorRectangle : const QRectF

This property holds the cursor rectangle.

This property is changed when the cursor rectangle changes.

Access functions:

QRectF cursorRectangle() const

Notifier signal:

void cursorRectangleChanged()

focus : const bool

This property holds the focus status.

This property is changed when the input method receives or loses focus.

Access functions:

bool focus() const

Notifier signal:

void focusChanged()

inputEngine : QtVirtualKeyboard::InputEngine * const

This property holds the input engine.

This property stores the input engine.

Access functions:

InputEngine *inputEngine() const

inputItem : QObject * const

This property holds the focused input item.

This property is changed when the focused input item changes.

Access functions:

QObject *inputItem() const

Notifier signal:

void inputItemChanged()

inputMethodHints : const Qt::InputMethodHints

This property holds the input method hints.

This property is changed when the input method hints changes.

Access functions:

Qt::InputMethodHints inputMethodHints() const

Notifier signal:

void inputMethodHintsChanged()

keyboardRectangle : QRectF

This property holds the keyboard rectangle.

Use this property to set the keyboard rectangle.

Access functions:

QRectF keyboardRectangle() const
void setKeyboardRectangle(QRectF rectangle)

Notifier signal:

void keyboardRectangleChanged()

locale : QString

This property holds the locale.

Sets the locale for this input context.

Access functions:

QString locale() const
void setLocale(const QString &locale)

Notifier signal:

void localeChanged()

preeditText : QString

This property holds the pre-edit text.

This property sets the pre-edit text.

Access functions:

QString preeditText() const
void setPreeditText(const QString &text, QList<QInputMethodEvent::Attribute> attributes = QList<QInputMethodEvent::Attribute> (), int replaceFrom = 0, int replaceLength = 0)

Notifier signal:

void preeditTextChanged()

previewRectangle : QRectF

This property holds the preview rectangle.

Use this property to set the preview rectangle.

Access functions:

QRectF previewRectangle() const
void setPreviewRectangle(QRectF rectangle)

Notifier signal:

void previewRectangleChanged()

previewVisible : bool

This property holds the animating status.

Use this property to set the visibility status of the preview.

Access functions:

bool previewVisible() const
void setPreviewVisible(bool visible)

Notifier signal:

void previewVisibleChanged()

selectedText : const QString

This property holds the selected text.

This property is changed when the selected text changes.

Access functions:

QString selectedText() const

Notifier signal:

void selectedTextChanged()

selectionControlVisible : const bool

Access functions:

bool selectionControlVisible() const

Notifier signal:

void selectionControlVisibleChanged()

shift : bool

This property holds the shift status.

This property is changed when the shift status changes.

Access functions:

bool shift() const
void setShift(bool enable)

Notifier signal:

void shiftChanged()

shiftHandler : QtVirtualKeyboard::ShiftHandler * const

This property holds the shift handler instance.

This property stores the shift handler.

Access functions:

ShiftHandler *shiftHandler() const

surroundingText : const QString

This property holds the surrounding text around cursor.

This property is changed when the surrounding text around the cursor changes.

Access functions:

QString surroundingText() const

Notifier signal:

void surroundingTextChanged()

Member Function Documentation

void InputContext::clear()

Clears the pre-edit text.

void InputContext::commit()

Commits the current pre-edit text.

void InputContext::commit(const QString &text, int replaceFrom = 0, int replaceLength = 0)

Commits the final text to the input item and optionally modifies the text relative to the start of the pre-edit text. If replaceFrom is non-zero, the text replaces the contents relative to replaceFrom with a length of replaceLength.

[signal] void InputContext::focusEditorChanged()

This signal is emitted when the focus editor changes.

void InputContext::hideInputPanel()

This method hides the input panel. This method should only be called when the user initiates the hide, e.g. by pressing a dedicated button on the keyboard.

void InputContext::sendKeyClick(int key, const QString &text, int modifiers = 0)

Sends a key click event with the given key, text and modifiers to the input item that currently has focus.

void InputContext::setSelectionOnFocusObject(const QPointF &anchorPos, const QPointF &cursorPos)