QPointerEvent Class

A base class for pointer events. 更多...

头: #include <QPointerEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.0
继承: QInputEvent
继承者: QSinglePointEvent and QTouchEvent

公共函数

bool addPassiveGrabber (const QEventPoint & point , QObject * grabber )
bool allPointsAccepted () const
bool allPointsGrabbed () const
void clearPassiveGrabbers (const QEventPoint & point )
QObject * exclusiveGrabber (const QEventPoint & point ) 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 )

重实现公共函数

virtual void setAccepted (bool accepted ) override

详细描述

成员函数文档编制

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 输入处理程序 .

返回 false if grabber was already added, true 否则。

bool QPointerEvent:: allPointsAccepted () const

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

bool QPointerEvent:: allPointsGrabbed () const

返回 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 输入处理程序 .

另请参阅 QPointerEvent::addPassiveGrabber ().

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.

另请参阅 setExclusiveGrabber ().

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 输入处理程序 .

另请参阅 QPointerEvent::addPassiveGrabber ().

QEventPoint &QPointerEvent:: point ( qsizetype i )

返回 QEventPoint reference for the point at index i .

QEventPoint *QPointerEvent:: pointById ( int id )

Returns the point whose id matches the given id ,或 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

返回生成事件的点类型。

const QPointingDevice *QPointerEvent:: pointingDevice () const

Returns the source device from which this event originates.

这如同 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 从给定 point if it was previously added. Returns true if it had been a passive grabber before, false 若不。

It's only for use by Qt Quick 输入处理程序 .

另请参阅 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.

另请参阅 exclusiveGrabber ().