![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qevent.h>
Public Member Functions | |
QInputEvent (Type type, const QInputDevice *m_dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
const QInputDevice * | device () const |
QInputDevice::DeviceType | deviceType () const |
Returns the type of device that generated the event. | |
Qt::KeyboardModifiers | modifiers () const |
Returns the keyboard modifier flags that existed immediately before the event occurred. | |
void | setModifiers (Qt::KeyboardModifiers modifiers) |
quint64 | timestamp () const |
Returns the window system's timestamp for this event. | |
virtual void | setTimestamp (quint64 timestamp) |
![]() | |
QEvent (Type type) | |
Constructs an event object of type type. | |
virtual | ~QEvent () |
Destroys the event. | |
Type | type () const |
Returns the event type. | |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false . | |
virtual void | setAccepted (bool accepted) |
bool | isAccepted () const |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). | |
bool | isInputEvent () const noexcept |
bool | isPointerEvent () const noexcept |
bool | isSinglePointEvent () const noexcept |
virtual QEvent * | clone () const |
Creates and returns an identical copy of this event. | |
Protected Member Functions | |
QInputEvent (Type type, PointerEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
QInputEvent (Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
![]() | |
QEvent (Type type, InputEventTag) | |
QEvent (Type type, PointerEventTag) | |
QEvent (Type type, SinglePointEventTag) | |
Protected Attributes | |
const QInputDevice * | m_dev = nullptr |
quint64 | m_timeStamp = 0 |
Qt::KeyboardModifiers | m_modState = Qt::NoModifier |
quint32 | m_reserved = 0 |
![]() | |
quint16 | t |
\inmodule QtGui
The QInputEvent class is the base class for events that describe user input.
|
explicit |
Definition at line 147 of file qevent.cpp.
|
protected |
|
protected |
|
inline |
Returns the source device that generated the original event.
In case of a synthesized event, for example a mouse event that was generated from a touch event, device()
continues to return the touchscreen device, so that you can tell that it did not come from an actual mouse. Thus {mouseEvent.source()->type()
!= QInputDevice::DeviceType::Mouse} is one possible replacement for the Qt 5 expression {mouseEvent.source()
== Qt::MouseEventSynthesizedByQt}.
Definition at line 54 of file qevent.h.
Referenced by QQuickDeliveryAgentPrivate::deliverToPassiveGrabbers(), QQuickDeliveryAgentPrivate::isEventFromMouseOrTouchpad(), operator<<(), and QQuickDeliveryAgentPrivate::touchToMouseEvent().
|
inline |
Returns the type of device that generated the event.
Definition at line 55 of file qevent.h.
References QInputDevice::type, and QInputDevice::Unknown.
|
inline |
Returns the keyboard modifier flags that existed immediately before the event occurred.
Definition at line 56 of file qevent.h.
Referenced by QGuiApplicationPrivate::captureGlobalModifierState(), QQuickDeliveryAgentPrivate::deliverTouchAsMouse(), QQuickDeliveryAgent::event(), QKeyEvent::modifiers(), QApplication::notify(), operator<<(), QWidgetTextControl::processEvent(), QFlickGestureRecognizer::recognize(), PressDelayHandler::sendMouseEvent(), and QGraphicsScenePrivate::touchEventHandler().
|
inline |
Sets the timestamp for this event.
Reimplemented in QPointerEvent.
Definition at line 59 of file qevent.h.
Referenced by QGuiApplicationPrivate::processKeyEvent(), qt_sendShortcutOverrideEvent(), and QPointerEvent::setTimestamp().
|
inline |
Returns the window system's timestamp for this event.
It will normally be in milliseconds since some arbitrary point in time, such as the time when the system was started.
Definition at line 58 of file qevent.h.
Referenced by QQuickDeliveryAgentPrivate::deliverTouchAsMouse(), QQuickDeliveryAgent::event(), QIBusPlatformInputContext::filterEvent(), QApplication::notify(), PressDelayHandler::sendMouseEvent(), QPointerEvent::setTimestamp(), QGraphicsScenePrivate::touchEventHandler(), and QApplicationPrivate::translateRawTouchEvent().
|
protected |
Definition at line 65 of file qevent.h.
Referenced by QPointerEvent::pointingDevice().
|
protected |