QVirtualKeyboardInputContext Class
入力コンテキストへのアクセスを提供します。詳細...
| ヘッダー: | #include <QVirtualKeyboardInputContext> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS VirtualKeyboard) target_link_libraries(mytarget PRIVATE Qt6::VirtualKeyboard) |
| qmake: | QT += virtualkeyboard |
| QML内: | 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> 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() |
プロパティのドキュメント
[read-only] anchorPosition : int
このプロパティは、アンカーの位置を保持します。
このプロパティは、アンカー位置が変更されると変更されます。
アクセス関数:
| int | anchorPosition() const |
通知シグナル:
| void | anchorPositionChanged() |
[read-only] anchorRectIntersectsClipRect : bool
選択アンカーの境界矩形が、公開された入力項目の矩形と交差する場合、true を返します。
アクセス関数:
| bool | anchorRectIntersectsClipRect() const |
通知シグナル:
| void | anchorRectIntersectsClipRectChanged() |
Qt::ImAnchorRectangle およびQt::ImInputItemClipRectangleも参照してください 。
[read-only] anchorRectangle : QRectF
このプロパティは、アンカー矩形を保持します。
このプロパティは、アンカー矩形が変更された際に更新されます。
アクセス関数:
| QRectF | anchorRectangle() const |
通知シグナル:
| void | anchorRectangleChanged() |
animating : bool
このプロパティは、アニメーションの状態を保持します。
このプロパティを使用して、たとえば UI の遷移状態の際などに、アニメーション状態を設定します。
アクセス関数:
| bool | isAnimating() const |
| void | setAnimating(bool isAnimating) |
Notifierシグナル:
| void | animatingChanged() |
[read-only] capsLockActive : bool
このプロパティは、Caps Lockの状態を保持します。
このプロパティは、Caps Lockの状態が変化した際に変更されます。
アクセス関数:
| bool | isCapsLockActive() const |
通知シグナル:
| void | capsLockActiveChanged() |
[read-only] cursorPosition : int
このプロパティは、カーソルの位置を保持します。
このプロパティは、カーソルの位置が変更された際に更新されます。
アクセス関数:
| int | cursorPosition() const |
通知シグナル:
| void | cursorPositionChanged() |
[read-only] cursorRectIntersectsClipRect : bool
入力カーソルの境界矩形が、公開されている入力項目の矩形と交差する場合、true を返します。
アクセス関数:
| bool | cursorRectIntersectsClipRect() const |
通知シグナル:
| void | cursorRectIntersectsClipRectChanged() |
Qt::ImCursorRectangle およびQt::ImInputItemClipRectangleも参照してください 。
[read-only] cursorRectangle : QRectF
このプロパティは、カーソル矩形を保持します。
このプロパティは、カーソル矩形が変更された際に変更されます。
アクセス関数:
| QRectF | cursorRectangle() const |
通知シグナル:
| void | cursorRectangleChanged() |
[read-only] inputEngine : QVirtualKeyboardInputEngine* const
このプロパティには、入力エンジンが格納されます。
このプロパティには、入力エンジンが格納されます。
アクセス関数:
| QVirtualKeyboardInputEngine * | inputEngine() const |
[read-only] inputMethodHints : Qt::InputMethodHints
このプロパティには、入力方法のヒントが格納されます。
このプロパティは、入力方法のヒントが変更された際に更新されます。
アクセス関数:
| Qt::InputMethodHints | inputMethodHints() const |
通知シグナル:
| void | inputMethodHintsChanged() |
[read-only, since 6.1] keyboardObserver : QVirtualKeyboardObserver* const
キーボードの変更イベントに関する通知を受け取るために使用できる、キーボードオブザーバーオブジェクトを保持します。
この列挙型は Qt 6.1 で導入されました。
アクセス関数:
| QVirtualKeyboardObserver * | keyboardObserver() const |
[read-only] locale : QString
このプロパティにはロケールが格納されます。
このプロパティは、入力のロケールが変更されると変更されます。
アクセス関数:
| QString | locale() const |
通知シグナル:
| void | localeChanged() |
preeditText : QString
このプロパティには、編集前のテキストが格納されます。
このプロパティは、編集前のテキストを設定します。
アクセス関数:
| QString | preeditText() const |
| void | setPreeditText(const QString &text, QList<QInputMethodEvent::Attribute> attributes = QList<QInputMethodEvent::Attribute>(), int replaceFrom = 0, int replaceLength = 0) |
通知シグナル:
| void | preeditTextChanged() |
[read-only] selectedText : QString
このプロパティには、選択されたテキストが格納されます。
このプロパティは、選択されたテキストが変更されると更新されます。
アクセス関数:
| QString | selectedText() const |
通知シグナル:
| void | selectedTextChanged() |
[read-only] selectionControlVisible : bool
選択コントロールが現在表示されている場合、true を保持します。
アクセス関数:
| bool | isSelectionControlVisible() const |
通知シグナル:
| void | selectionControlVisibleChanged() |
[read-only] shiftActive : bool
このプロパティはシフトステータスを保持します。
このプロパティは、シフトステータスが変更された際に更新されます。
アクセス関数:
| bool | isShiftActive() const |
通知信号:
| void | shiftActiveChanged() |
[read-only] surroundingText : QString
このプロパティは、カーソルの周囲のテキストを保持します。
このプロパティは、カーソル周辺のテキストが変更された際に更新されます。
アクセス関数:
| QString | surroundingText() const |
通知シグナル:
| void | surroundingTextChanged() |
[read-only] uppercase : bool
このプロパティは大文字化の状態を保持します。
shiftActive またはcapsLockActive のいずれかがtrue である場合、このプロパティは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 を入力項目にコミットし、必要に応じて編集前のテキストの先頭からの位置を基準にテキストを修正します。replaceFrom が0以外の場合、text は、replaceFrom を基準とする範囲を、replaceLength の長さ分だけ置き換えます。
注:この関数は 、メタオブジェクトシステムを介して、またはQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QVirtualKeyboardInputContext::sendKeyClick(int key, const QString &text, int modifiers = 0)
指定されたkey 、text 、modifiers を含むキークリックイベントを、現在フォーカスを持っている入力項目に送信します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
© 2026 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.