このページでは

InputContext QML Type (Singleton)

入力コンテキストへのアクセスを提供します。詳細...

Import Statement: import QtQuick.VirtualKeyboard
In C++: QVirtualKeyboardInputContext

注:この型は QML シングルトンです。QML エンジン内には、この型のインスタンスが 1 つしか存在しません。

プロパティ

方法

詳細な説明

InputContext には、シングルトンインスタンスとしてアクセスできます。

プロパティのドキュメント

anchorPosition : int [read-only, since QtQuick.VirtualKeyboard 2.2]

このプロパティは、アンカーの位置が変更された際に変更されます。

このプロパティは、QtQuick.VirtualKeyboard 2.2 で導入されました。

anchorRectIntersectsClipRect : bool [read-only]

選択アンカーの境界矩形が、公開された入力項目の矩形と交差する場合、true を返します。

「 Qt::ImAnchorRectangle 」および「Qt::ImInputItemClipRectangle 」も参照してください 。

anchorRectangle : rect [read-only, since QtQuick.VirtualKeyboard 2.1]

このプロパティは、アンカー矩形が変更された際に変更されます。

このプロパティは、QtQuick.VirtualKeyboard 2.1 で導入されました。

animating : bool

このプロパティを使用して、たとえばUIの遷移状態などにおいて、アニメーションのステータスを設定します。

capsLockActive : bool [read-only, since QtQuick.VirtualKeyboard 2.4]

このプロパティは、Caps Lockの状態が変化した際に変更されます。

このプロパティは、QtQuick.VirtualKeyboard 2.4 で導入されました。

cursorPosition : int [read-only]

このプロパティは、カーソルの位置が変わると変更されます。

cursorRectIntersectsClipRect : bool [read-only]

入力カーソルの境界矩形が、公開されている入力項目の矩形と交差する場合、true を返します。

「 Qt::ImCursorRectangle 」および「Qt::ImInputItemClipRectangle 」も参照してください 。

cursorRectangle : rect [read-only]

このプロパティは、カーソル矩形が変更されたときに変更されます。

inputEngine : InputEngine [read-only]

このプロパティには、入力エンジンが格納されます。

inputMethodHints : int [read-only]

このプロパティは、入力メソッドのヒントが変更されたときに変更されます。

keyboardObserver : KeyboardObserver [read-only, since 6.1]

キーボードの変更イベントに関する通知を受け取るために使用できる、キーボードオブザーバーオブジェクトを保持します。

このプロパティは Qt 6.1 で導入されました。

locale : string [read-only]

このプロパティは、入力のロケールが変更されると変更されます。

preeditText : string

このプロパティは、編集前のテキストを設定します。

selectedText : string [read-only]

このプロパティは、選択されたテキストが変更されると変更されます。

selectionControlVisible : bool [read-only]

選択コントロールが現在表示されている場合、true を保持します。

shiftActive : bool [read-only, since QtQuick.VirtualKeyboard 2.4]

このプロパティは、シフト状態が変化した際に変更されます。

このプロパティは、QtQuick.VirtualKeyboard 2.4 で導入されました。

surroundingText : string [read-only]

このプロパティは、カーソルの周囲のテキストが変更された際に変更されます。

uppercase : bool [read-only, since QtQuick.VirtualKeyboard 2.2]

このプロパティは、shiftActive またはcapsLockActive のいずれかがtrue の場合に、true となります。

このプロパティは、QtQuick.VirtualKeyboard 2.2 で導入されました。

メソッドのドキュメント

void clear()

編集前のテキストを消去します。

void commit()

現在の編集前のテキストをコミットします。

void commit(string text, int replaceFrom = 0, int replaceLength = 0)

入力項目に対して最終的なtext を適用し、必要に応じて編集前のテキストの先頭からの位置を基準にテキストを変更します。replaceFromが0以外の場合、text はreplaceFromを基準とする範囲を、replaceLengthの長さ分だけ置き換えます。

void sendKeyClick(int key, string text, int modifiers = 0)

指定されたkey 、text 、modifiers を含むキークリックイベントを、現在フォーカスがある入力項目に送信します。

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