QInputEvent Class

Die Klasse QInputEvent ist die Basisklasse für Ereignisse, die Benutzereingaben beschreiben. Mehr...

Kopfzeile: #include <QInputEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Vererbt: QEvent
Vererbt von:

QContextMenuEvent, QKeyEvent, und QPointerEvent

Öffentliche Funktionen

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

Detaillierte Beschreibung

Dokumentation der Mitgliedsfunktionen

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

Gibt das Quellgerät zurück, das das ursprüngliche Ereignis erzeugt hat.

Im Falle eines synthetisierten Ereignisses, z.B. eines Maus-Ereignisses, das aus einem Touch-Ereignis erzeugt wurde, gibt device() weiterhin das Touchscreen-Gerät zurück, so dass Sie erkennen können, dass es nicht von einer tatsächlichen Maus stammt. Somit ist mouseEvent.source()->type() != QInputDevice::DeviceType::Mouse ein möglicher Ersatz für den Qt 5 Ausdruck mouseEvent.source() == Qt::MouseEventSynthesizedByQt.

Diese Funktion wurde in Qt 6.0 eingeführt.

Siehe auch QPointerEvent::pointingDevice().

QInputDevice::DeviceType QInputEvent::deviceType() const

Gibt den Typ des Geräts zurück, das das Ereignis ausgelöst hat.

Qt::KeyboardModifiers QInputEvent::modifiers() const

Gibt die Keyboard Modifier Flags zurück, die unmittelbar vor dem Auftreten des Ereignisses existierten.

Siehe auch QGuiApplication::keyboardModifiers().

quint64 QInputEvent::timestamp() const

Gibt den Zeitstempel des Fenstersystems für dieses Ereignis zurück. Er wird normalerweise in Millisekunden seit einem beliebigen Zeitpunkt angegeben, z. B. dem Zeitpunkt, an dem das System gestartet wurde.

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