QVirtualKeyboardInputContext 类

提供对输入上下文的访问。 更多...

头: #include <QVirtualKeyboardInputContext>
CMake: find_package(Qt6 COMPONENTS VirtualKeyboard REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::VirtualKeyboard)
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
QVirtualKeyboardObserver * keyboardObserver () 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> 属性 = 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 ()

详细描述

特性文档编制

[read-only] anchorPosition : const int

此特性保持锚点位置。

此特性被改变,当锚点位置改变时。

访问函数:

int anchorPosition () const

通知程序信号:

void anchorPositionChanged ()

[read-only] 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 .

[read-only] anchorRectangle : const QRectF

此特性保持锚点矩形。

This property is changed when the anchor rectangle changes.

访问函数:

QRectF anchorRectangle () const

通知程序信号:

void anchorRectangleChanged ()

animating : bool

此特性保持动画状态。

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

访问函数:

bool isAnimating () const
void setAnimating (bool isAnimating )

通知程序信号:

void animatingChanged ()

[read-only] capsLockActive : const bool

此特性保持大写锁定状态。

此特性被改变,当大写锁定状态改变时。

访问函数:

bool isCapsLockActive () const

通知程序信号:

void capsLockActiveChanged ()

[read-only] cursorPosition : const int

此特性保持光标位置。

此特性被改变,当光标位置改变时。

访问函数:

int cursorPosition () const

通知程序信号:

void cursorPositionChanged ()

[read-only] 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 .

[read-only] cursorRectangle : const QRectF

此特性保持光标矩形。

This property is changed when the cursor rectangle changes.

访问函数:

QRectF cursorRectangle () const

通知程序信号:

void cursorRectangleChanged ()

[read-only] inputEngine : QVirtualKeyboardInputEngine * const

此特性保持输入引擎。

This property stores the input engine.

访问函数:

QVirtualKeyboardInputEngine * inputEngine () const

[read-only] inputMethodHints : const Qt::InputMethodHints

此特性保持输入法提示。

This property is changed when the input method hints changes.

访问函数:

Qt::InputMethodHints inputMethodHints () const

通知程序信号:

void inputMethodHintsChanged ()

[read-only, since QtQuick.VirtualKeyboard 6.1] keyboardObserver : QVirtualKeyboardObserver * const

Holds the keyboard observer object, which can be used to receive notifications of keyboard change events.

This property was introduced in QtQuick.VirtualKeyboard 6.1.

访问函数:

QVirtualKeyboardObserver * keyboardObserver () const

[read-only] locale : const QString

此特性保持区域设置。

This property is changed when the input locale changes.

访问函数:

QString locale () const

通知程序信号:

void localeChanged ()

preeditText : QString

此特性保持预编辑文本。

This property sets the pre-edit text.

访问函数:

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

通知程序信号:

void preeditTextChanged ()

[read-only] selectedText : const QString

此特性保持选中文本。

This property is changed when the selected text changes.

访问函数:

QString selectedText () const

通知程序信号:

void selectedTextChanged ()

[read-only] selectionControlVisible : const bool

保持 true if the selection control is currently visible.

访问函数:

bool isSelectionControlVisible () const

通知程序信号:

void selectionControlVisibleChanged ()

[read-only] shiftActive : const bool

此特性保持 Shift 状态。

This property is changed when the shift status changes.

访问函数:

bool isShiftActive () const

通知程序信号:

void shiftActiveChanged ()

[read-only] surroundingText : const QString

此特性保持围绕光标的周围文本。

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

访问函数:

QString surroundingText () const

通知程序信号:

void surroundingTextChanged ()

[read-only] uppercase : const bool

此特性保持大写状态。

此特性是 true shiftActive or capsLockActive is true .

访问函数:

bool isUppercase () const

通知程序信号:

void uppercaseChanged ()

成员函数文档编制

[invokable] void QVirtualKeyboardInputContext:: clear ()

清零预编辑文本。

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

[invokable] void QVirtualKeyboardInputContext:: commit ()

提交当前的预编辑文本。

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

[invokable] void QVirtualKeyboardInputContext:: commit (const QString & text , int replaceFrom = 0, int replaceLength = 0)

提交最终 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 .

[invokable] void QVirtualKeyboardInputContext:: sendKeyClick ( int key , const QString & text , int modifiers = 0)

发送键点击事件采用给定 key , text and modifiers 到目前拥有聚焦的输入项。

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