QInputEvent Class

QInputEventクラスは、ユーザー入力を表すイベントの基本クラスです。詳細...

ヘッダー #include <QInputEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
を継承する: QEvent
によって継承される:

QContextMenuEvent,QKeyEvent, およびQPointerEvent

パブリック関数

(since 6.0) const QInputDevice *device() const
QInputDevice::DeviceType deviceType() const
Qt::KeyboardModifiers modifiers() const
quint64 timestamp() const

詳細説明

メンバ関数ドキュメント

[since 6.0] const QInputDevice *QInputEvent::device() const

元のイベントを生成したソース・デバイスを返す。

合成されたイベント、例えばタッチ・イベントから生成されたマウス・イベントの場合、device() はタッチスクリーン・デバイスを返し続けるので、実際のマウスから生成されたものではないことがわかります。このように、mouseEvent.source()->type() != QInputDevice::DeviceType::Mouse は Qt 5 の式mouseEvent.source() == Qt::MouseEventSynthesizedByQt の代替となる可能性があります。

この関数は Qt 6.0 で導入されました。

QPointerEvent::pointingDevice()も参照してください

QInputDevice::DeviceType QInputEvent::deviceType() const

イベントを発生させたデバイスのタイプを返します。

Qt::KeyboardModifiers QInputEvent::modifiers() const

イベント発生直前のキーボード修飾フラグを返す。

QGuiApplication::keyboardModifiers()も参照

quint64 QInputEvent::timestamp() 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.