QMouseHandler Class

(Qt3DInput::QMouseHandler)

Provides a means of being notified about mouse events when attached to a QMouseDevice instance. 更多...

头文件: #include <Qt3DInput/QMouseHandler>
qmake: QT += 3dinput
开始支持版本: Qt 5.5
Instantiated By: MouseHandler
基类: Qt3DCore::QComponent

属性

公有函数

QMouseHandler(QNode *parent = nullptr)
~QMouseHandler()
bool containsMouse() const
QMouseDevice *sourceDevice() const

公有槽函数

void setSourceDevice(QMouseDevice *mouseDevice)

信号

void clicked(Qt3DInput::QMouseEvent *mouse)
void containsMouseChanged(bool containsMouse)
void doubleClicked(Qt3DInput::QMouseEvent *mouse)
void entered()
void exited()
void positionChanged(Qt3DInput::QMouseEvent *mouse)
void pressAndHold(Qt3DInput::QMouseEvent *mouse)
void pressed(Qt3DInput::QMouseEvent *mouse)
void released(Qt3DInput::QMouseEvent *mouse)
void sourceDeviceChanged(QMouseDevice *mouseDevice)
void wheel(Qt3DInput::QWheelEvent *wheel)

其他继承的成员

详细描述

Provides a means of being notified about mouse events when attached to a QMouseDevice instance.

Note: QMouseHandler components shouldn't be shared, not respecting that condition will most likely result in undefined behaviors.

参见 QMouseDevice.

属性

containsMouse : const bool

Holds true if the QMouseHandler currently contains the mouse.

Note: In this context, contains mean that the ray originating from the mouse is intersecting with the Qt3DCore::QEntity that aggregates the current QMouseHandler instance component.

访问函数:

bool containsMouse() const

Notifier signal:

void containsMouseChanged(bool containsMouse)

sourceDevice : Qt3DInput::QMouseDevice *

Holds the current mouse source device of the QMouseHandler instance.

访问函数:

QMouseDevice *sourceDevice() const
void setSourceDevice(QMouseDevice *mouseDevice)

Notifier signal:

void sourceDeviceChanged(QMouseDevice *mouseDevice)

成员函数

QMouseHandler::QMouseHandler(QNode *parent = nullptr)

Constructs a new QMouseHandler instance with parent parent.

QMouseHandler::~QMouseHandler()

Destroys the instance of QMouseHandler.

[signal] void QMouseHandler::clicked(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is clicked with the event details being contained within mouse

[signal] void QMouseHandler::doubleClicked(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is double clicked with the event details being contained within mouse

[signal] void QMouseHandler::entered()

[signal] void QMouseHandler::exited()

[signal] void QMouseHandler::positionChanged(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when the mouse position changes with the event details being contained within mouse

[signal] void QMouseHandler::pressAndHold(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is pressed and held down with the event details being contained within mouse

[signal] void QMouseHandler::pressed(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is pressed with the event details being contained within mouse

[signal] void QMouseHandler::released(Qt3DInput::QMouseEvent *mouse)

This signal is emitted when a mouse button is released with the event details being contained within mouse

[slot] void QMouseHandler::setSourceDevice(QMouseDevice *mouseDevice)

Sets the mouse device of the QMouseHandler instance to mouseDevice.

Note: Setter function for property sourceDevice.

参见 sourceDevice().

[signal] void QMouseHandler::wheel(Qt3DInput::QWheelEvent *wheel)

This signal is emitted when the mouse wheel is used with the event details being contained within wheel