QVirtualKeyboardInputContext Class

Provides access to an input context. 更多...

头: #include <QVirtualKeyboardInputContext>
qmake: QT += virtualkeyboard
实例化: InputContext
继承: QObject

特性

公共函数

int anchorPosition () const
bool anchorRectIntersectsClipRect () const
QRectF anchorRectangle () 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
QVirtualKeyboardInputEngine * inputEngine () const
Qt::InputMethodHints inputMethodHints () const
bool isAnimating () const
bool isCapsLockActive () const
bool isSelectionControlVisible () const
bool isShiftActive () const
bool isUppercase () const
QString locale () const
QString preeditText () const
QString selectedText () const
void sendKeyClick (int key , const QString & text , int modifiers = 0)
void setAnimating (bool isAnimating )
void setPreeditText (const QString & text , QList<QInputMethodEvent::Attribute> attributes = QList<QInputMethodEvent::Attribute>(), int replaceFrom = 0, int replaceLength = 0)
QString surroundingText () const

信号

void anchorPositionChanged ()
void anchorRectIntersectsClipRectChanged ()
void anchorRectangleChanged ()
void animatingChanged ()
void capsLockActiveChanged ()
void cursorPositionChanged ()
void cursorRectIntersectsClipRectChanged ()
void cursorRectangleChanged ()
void inputMethodHintsChanged ()
void localeChanged ()
void preeditTextChanged ()
void selectedTextChanged ()
void selectionControlVisibleChanged ()
void shiftActiveChanged ()
void surroundingTextChanged ()
void uppercaseChanged ()

详细描述

特性文档编制

anchorPosition : const int

This property holds the anchor position.

This property is changed when the anchor position changes.

访问函数:

int anchorPosition () const

通知程序信号:

void anchorPositionChanged ()

anchorRectIntersectsClipRect : const bool

保持 true if the bounding rectangle of the selection anchor intersects the exposed input item rectangle.

访问函数:

bool anchorRectIntersectsClipRect () const

通知程序信号:

void anchorRectIntersectsClipRectChanged ()

另请参阅 Qt::ImAnchorRectangle and Qt::ImInputItemClipRectangle .

anchorRectangle : const QRectF

This property holds the anchor rectangle.

This property is changed when the anchor rectangle changes.

访问函数:

QRectF anchorRectangle () const

通知程序信号:

void anchorRectangleChanged ()

animating : bool

This property holds the animating status.

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

访问函数:

bool isAnimating () const
void setAnimating (bool isAnimating )

通知程序信号:

void animatingChanged ()

capsLockActive : const bool

This property holds the caps lock status.

This property is changed when the caps lock status changes.

访问函数:

bool isCapsLockActive () const

通知程序信号:

void capsLockActiveChanged ()

cursorPosition : const int

This property holds the cursor position.

This property is changed when the cursor position changes.

访问函数:

int cursorPosition () const

通知程序信号:

void cursorPositionChanged ()

cursorRectIntersectsClipRect : const bool

保持 true if the bounding rectangle of the input cursor intersects the exposed input item rectangle.

访问函数:

bool cursorRectIntersectsClipRect () const

通知程序信号:

void cursorRectIntersectsClipRectChanged ()

另请参阅 Qt::ImCursorRectangle and Qt::ImInputItemClipRectangle .

cursorRectangle : const QRectF

This property holds the cursor rectangle.

This property is changed when the cursor rectangle changes.

访问函数:

QRectF cursorRectangle () const

通知程序信号:

void cursorRectangleChanged ()

inputEngine : QVirtualKeyboardInputEngine * const

This property holds the input engine.

This property stores the input engine.

访问函数:

QVirtualKeyboardInputEngine * inputEngine () const

inputMethodHints : const Qt::InputMethodHints

This property holds the input method hints.

This property is changed when the input method hints changes.

访问函数:

Qt::InputMethodHints inputMethodHints () const

通知程序信号:

void inputMethodHintsChanged ()

locale : const QString

This property holds the locale.

This property is changed when the input locale changes.

访问函数:

QString locale () const

通知程序信号:

void localeChanged ()

preeditText : QString

This property holds the pre-edit text.

This property sets the pre-edit text.

访问函数:

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

通知程序信号:

void preeditTextChanged ()

selectedText : const QString

此特性保持选中文本。

This property is changed when the selected text changes.

访问函数:

QString selectedText () const

通知程序信号:

void selectedTextChanged ()

selectionControlVisible : const bool

保持 true if the selection control is currently visible.

访问函数:

bool isSelectionControlVisible () const

通知程序信号:

void selectionControlVisibleChanged ()

shiftActive : const bool

This property holds the shift status.

This property is changed when the shift status changes.

访问函数:

bool isShiftActive () const

通知程序信号:

void shiftActiveChanged ()

surroundingText : const QString

This property holds the surrounding text around cursor.

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

访问函数:

QString surroundingText () const

通知程序信号:

void surroundingTextChanged ()

uppercase : const bool

This property holds the uppercase status.

此特性是 true when either shiftActive or capsLockActive is true .

访问函数:

bool isUppercase () const

通知程序信号:

void uppercaseChanged ()

成员函数文档编制

void QVirtualKeyboardInputContext:: clear ()

Clears the pre-edit text.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

void QVirtualKeyboardInputContext:: commit ()

Commits the current pre-edit text.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

void QVirtualKeyboardInputContext:: 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 .

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

void QVirtualKeyboardInputContext:: 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.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .