Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
A base class for pointer events. More...
#include <qevent.h>
Public Member Functions | |
QPointerEvent (Type type, const QPointingDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier, const QList< QEventPoint > &points={}) | |
const QPointingDevice * | pointingDevice () const |
Returns the source device from which this event originates. | |
QPointingDevice::PointerType | pointerType () const |
Returns the type of point that generated the event. | |
void | setTimestamp (quint64 timestamp) override |
qsizetype | pointCount () const |
Returns the number of points in this pointer event. | |
QEventPoint & | point (qsizetype i) |
Returns a QEventPoint reference for the point at index i. | |
const QList< QEventPoint > & | points () const |
Returns a list of points in this pointer event. | |
QEventPoint * | pointById (int id) |
Returns the point whose \l {QEventPoint::id()}{id} matches the given id, or nullptr if no such point is found. | |
bool | allPointsGrabbed () const |
Returns true if every point in points() has either an exclusiveGrabber() or one or more passiveGrabbers(). | |
virtual bool | isBeginEvent () const |
virtual bool | isUpdateEvent () const |
virtual bool | isEndEvent () const |
bool | allPointsAccepted () const |
Returns true if isPointAccepted() is true for every point in points(); otherwise false . | |
virtual void | setAccepted (bool accepted) override |
\reimp | |
QObject * | exclusiveGrabber (const QEventPoint &point) const |
Returns the object which has been set to receive all future update events and the release event containing the given point. | |
void | setExclusiveGrabber (const QEventPoint &point, QObject *exclusiveGrabber) |
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and the release event containing the given point, and that delivery to other items can be skipped. | |
QList< QPointer< QObject > > | passiveGrabbers (const QEventPoint &point) const |
Returns the list of objects that have been requested to receive all future update events and the release event containing the given point. | |
void | clearPassiveGrabbers (const QEventPoint &point) |
Removes all passive grabbers from the given point. | |
bool | addPassiveGrabber (const QEventPoint &point, QObject *grabber) |
Informs the delivery logic that the given grabber is to receive all future update events and the release event containing the given point, regardless where else those events may be delivered. | |
bool | removePassiveGrabber (const QEventPoint &point, QObject *grabber) |
Removes the passive grabber from the given point if it was previously added. | |
Public Member Functions inherited from QInputEvent | |
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. | |
Public Member Functions inherited from QEvent | |
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 . | |
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 | |
QPointerEvent (Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
Protected Member Functions inherited from QInputEvent | |
QInputEvent (Type type, PointerEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
QInputEvent (Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
Protected Member Functions inherited from QEvent | |
QT_DEFINE_TAG_STRUCT (InputEventTag) | |
QEvent (Type type, InputEventTag) | |
QT_DEFINE_TAG_STRUCT (PointerEventTag) | |
QEvent (Type type, PointerEventTag) | |
QT_DEFINE_TAG_STRUCT (SinglePointEventTag) | |
QEvent (Type type, SinglePointEventTag) | |
Protected Attributes | |
QList< QEventPoint > | m_points |
Protected Attributes inherited from QInputEvent | |
const QInputDevice * | m_dev = nullptr |
quint64 | m_timeStamp = 0 |
Qt::KeyboardModifiers | m_modState = Qt::NoModifier |
quint32 | m_reserved = 0 |
Protected Attributes inherited from QEvent | |
quint16 | t |
|
explicit |
|
protected |
bool QPointerEvent::addPassiveGrabber | ( | const QEventPoint & | point, |
QObject * | grabber ) |
Informs the delivery logic that the given grabber is to receive all future update events and the release event containing the given point, regardless where else those events may be delivered.
It's only for use by \l {Qt Quick Input Handlers}.
Returns false
if grabber was already added, true
otherwise.
Definition at line 404 of file qevent.cpp.
bool QPointerEvent::allPointsAccepted | ( | ) | const |
Returns true
if isPointAccepted() is true
for every point in points(); otherwise false
.
Definition at line 306 of file qevent.cpp.
bool QPointerEvent::allPointsGrabbed | ( | ) | const |
Returns true
if every point in points() has either an exclusiveGrabber() or one or more passiveGrabbers().
Definition at line 293 of file qevent.cpp.
void QPointerEvent::clearPassiveGrabbers | ( | const QEventPoint & | point | ) |
Removes all passive grabbers from the given point.
It's only for use by \l {Qt Quick Input Handlers}.
Definition at line 433 of file qevent.cpp.
QObject * QPointerEvent::exclusiveGrabber | ( | const QEventPoint & | point | ) | const |
Returns the object which has been set to receive all future update events and the release event containing the given point.
It's mainly for use in Qt Quick at this time.
Definition at line 351 of file qevent.cpp.
|
inlinevirtual |
Reimplemented in QSinglePointEvent, and QTouchEvent.
|
inlinevirtual |
Reimplemented in QSinglePointEvent, and QTouchEvent.
|
inlinevirtual |
Reimplemented in QHoverEvent, QSinglePointEvent, and QTouchEvent.
QList< QPointer< QObject > > QPointerEvent::passiveGrabbers | ( | const QEventPoint & | point | ) | const |
Returns the list of objects that have been requested to receive all future update events and the release event containing the given point.
It's only for use by \l {Qt Quick Input Handlers}.
Definition at line 384 of file qevent.cpp.
QEventPoint & QPointerEvent::point | ( | qsizetype | i | ) |
Returns a QEventPoint reference for the point at index i.
Definition at line 240 of file qevent.cpp.
QEventPoint * QPointerEvent::pointById | ( | int | id | ) |
Returns the point whose \l {QEventPoint::id()}{id} matches the given id, or nullptr
if no such point is found.
Definition at line 280 of file qevent.cpp.
|
inline |
|
inline |
const QPointingDevice * QPointerEvent::pointingDevice | ( | ) | const |
Returns the source device from which this event originates.
This is the same as QInputEvent::device() but typecast for convenience.
Definition at line 330 of file qevent.cpp.
|
inline |
bool QPointerEvent::removePassiveGrabber | ( | const QEventPoint & | point, |
QObject * | grabber ) |
Removes the passive grabber from the given point if it was previously added.
Returns true
if it had been a passive grabber before, false
if not.
It's only for use by \l {Qt Quick Input Handlers}.
Definition at line 419 of file qevent.cpp.
|
overridevirtual |
void QPointerEvent::setExclusiveGrabber | ( | const QEventPoint & | point, |
QObject * | exclusiveGrabber ) |
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and the release event containing the given point, and that delivery to other items can be skipped.
It's mainly for use in Qt Quick at this time.
Definition at line 369 of file qevent.cpp.
Sets the timestamp for this event and its points().
Reimplemented from QInputEvent.
Definition at line 338 of file qevent.cpp.
|
protected |