QKeyEvent Class
class Qt3DInput::QKeyEventKeyBoardHandlerが送信するQKeyEventイベントタイプです。詳細...
ヘッダー | #include <QKeyEvent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dinput) target_link_libraries(mytarget PRIVATE Qt6::3dinput) |
qmake | QT += 3dinput |
QML で | KeyEvent |
を継承しています: | QObject |
ステータス | 非推奨 |
プロパティ
|
|
パブリック機能
int | count() const |
bool | isAccepted() const |
bool | isAutoRepeat() const |
int | key() const |
bool | matches(QKeySequence::StandardKey key_) const |
int | modifiers() const |
quint32 | nativeScanCode() const |
void | setAccepted(bool accepted) |
QString | text() const |
QEvent::Type | type() const |
関連非会員
プロパティ・ドキュメンテーション
accepted : bool
acceptedを true
に設定すると、キーイベントがアイテムの親に伝搬されるのを防ぐことができます。
一般的に、アイテムがキーイベントに反応する場合、祖先のアイテムも同じイベントに反応しないように、acceptedにする必要があります。
アクセス関数:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
[read-only]
count : const int
このイベントに関係するキーの数を保持する。text が空でない場合、これは単に文字列の長さです。
アクセス関数:
int | count() const |
[read-only]
isAutoRepeat : const bool
このイベントがオートリピートキーによるものかどうかを保持する。
アクセス関数:
bool | isAutoRepeat() const |
[read-only]
key : const int
このプロパティは、押されたり離されたりしたキーのコードを保持する。
キーボードコードの一覧はQt.Key を参照。
QKeyEvent::key()も参照のこと。
アクセス関数:
int | key() const |
[read-only]
modifiers : const int
このプロパティは、イベントが発生する直前に存在していたキーボード修飾フラグを保持する。
QKeyEvent::modifiers()も参照。
アクセス関数:
int | modifiers() const |
[read-only]
nativeScanCode : const quint32
このプロパティは、押されたキーのネイティブスキャンコードを含む。QKeyEvent から変更されずに渡されます。
アクセス関数:
quint32 | nativeScanCode() const |
[read-only]
text : const QString
このプロパティは、キーが生成した Unicode テキストを保持します。Shift、Control、Alt、Metaなどの修飾キーが押されたり離されたりしている場合、返されるテキストは空文字列になることがあります。そのような場合、key は有効な値を含みます。
アクセス関数:
QString | text() const |
メンバー関数ドキュメント
[invokable]
bool QKeyEvent::matches(QKeySequence::StandardKey key_) const
キーイベントが与えられた標準キーkey_ にマッチする場合はtrue
を返し、そうでない場合はfalse
を返します。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
QKeySequence::StandardKeyも参照して ください。
QEvent::Type QKeyEvent::type() const
イベントのタイプを返します。
© 2025 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.