QPointerEvent Class

A base class for pointer events. More...

Header: #include <QPointerEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.0
Inherits: QInputEvent
Inherited By:

QSinglePointEvent and QTouchEvent

Public Functions

virtual ~QPointerEvent() override
bool addPassiveGrabber(const QEventPoint &point, QObject *grabber)
bool allPointsAccepted() const
bool allPointsGrabbed() const
void clearPassiveGrabbers(const QEventPoint &point)
QObject *exclusiveGrabber(const QEventPoint &point) const
virtual bool isBeginEvent() const
virtual bool isEndEvent() const
virtual bool isUpdateEvent() const
QList<QPointer<QObject>> passiveGrabbers(const QEventPoint &point) const
QEventPoint &point(qsizetype i)
QEventPoint *pointById(int id)
qsizetype pointCount() const
QPointingDevice::PointerType pointerType() const
const QPointingDevice *pointingDevice() const
const QList<QEventPoint> &points() const
bool removePassiveGrabber(const QEventPoint &point, QObject *grabber)
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)

Reimplemented Public Functions

virtual QPointerEvent *clone() const override
virtual void setAccepted(bool accepted) override

Protected Functions

QPointerEvent(const QPointerEvent &)
QPointerEvent(QPointerEvent &&)
QPointerEvent &operator=(const QPointerEvent &other)
QPointerEvent &operator=(QPointerEvent &&)

Protected Variables

QList<QEventPoint> m_points

Detailed Description

Member Function Documentation

[protected] QPointerEvent::QPointerEvent(const QPointerEvent &)

Default constructs an instance of QPointerEvent.

[protected] QPointerEvent::QPointerEvent(QPointerEvent &&)

Move-copy constructor.

[override virtual] QPointerEvent::~QPointerEvent()

Destroys the instance of QPointerEvent. The destructor is virtual.

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 Qt Quick Input Handlers.

Returns false if grabber was already added, true otherwise.

bool QPointerEvent::allPointsAccepted() const

Returns true if isPointAccepted() is true for every point in points(); otherwise false.

bool QPointerEvent::allPointsGrabbed() const

Returns true if every point in points() has either an exclusiveGrabber() or one or more passiveGrabbers().

void QPointerEvent::clearPassiveGrabbers(const QEventPoint &point)

Removes all passive grabbers from the given point.

It's only for use by Qt Quick Input Handlers.

See also QPointerEvent::addPassiveGrabber().

[override virtual] QPointerEvent *QPointerEvent::clone() const

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.

See also setExclusiveGrabber().

[virtual] bool QPointerEvent::isBeginEvent() const

[virtual] bool QPointerEvent::isEndEvent() const

[virtual] bool QPointerEvent::isUpdateEvent() const

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 Qt Quick Input Handlers.

See also QPointerEvent::addPassiveGrabber().

QEventPoint &QPointerEvent::point(qsizetype i)

Returns a QEventPoint reference for the point at index i.

QEventPoint *QPointerEvent::pointById(int id)

Returns the point whose id matches the given id, or nullptr if no such point is found.

qsizetype QPointerEvent::pointCount() const

Returns the number of points in this pointer event.

QPointingDevice::PointerType QPointerEvent::pointerType() const

Returns the type of point that generated the event.

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.

const QList<QEventPoint> &QPointerEvent::points() const

Returns a list of points in this pointer event.

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 Qt Quick Input Handlers.

See also QPointerEvent::addPassiveGrabber().

[override virtual] void QPointerEvent::setAccepted(bool accepted)

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.

See also exclusiveGrabber().

[protected] QPointerEvent &QPointerEvent::operator=(const QPointerEvent &other)

Copy-assignment operator.

[protected] QPointerEvent &QPointerEvent::operator=(QPointerEvent &&)

Move-assignment operator.

Member Variable Documentation

QList<QEventPoint> QPointerEvent::m_points

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