QMouseHandler Class

class Qt3DInput::QMouseHandler

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

Header: #include <Qt3DInput/QMouseHandler>
qmake: QT += 3dinput
Since: Qt 5.5
Instantiated By: MouseHandler
Inherits: Qt3DCore::QComponent

This class was introduced in Qt 5.5.

Properties

Public Functions

bool containsMouse() const
Qt3DInput::QMouseDevice *sourceDevice() const

Public Slots

void setSourceDevice(Qt3DInput::QMouseDevice *mouseDevice)

Signals

void containsMouseChanged(bool containsMouse)
void sourceDeviceChanged(Qt3DInput::QMouseDevice *mouseDevice)

Detailed Description

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

See also QMouseDevice and QMouseEvent.

Property Documentation

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.

Access functions:

bool containsMouse() const

Notifier signal:

void containsMouseChanged(bool containsMouse)

sourceDevice : Qt3DInput::QMouseDevice*

Holds the current mouse source device of the QMouseHandler instance.

Access functions:

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

Notifier signal:

void sourceDeviceChanged(Qt3DInput::QMouseDevice *mouseDevice)