QMouseHandler 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

QMouseHandler(Qt3DCore::QNode *parent = nullptr)
bool containsMouse() const
Qt3DInput::QMouseDevice *sourceDevice() const

Public Slots

void setSourceDevice(Qt3DInput::QMouseDevice *mouseDevice)

Signals

void containsMouseChanged(bool containsMouse)
void sourceDeviceChanged(Qt3DInput::QMouseDevice *mouseDevice)
typedef QNodePtr
typedef QNodeVector
typedef QObjectList
QList<T> qFindChildren(const QObject *obj, const QRegExp &regExp)
T qobject_cast(QObject *object)
T qobject_cast(const QObject *object)

Macros

Additional Inherited Members

  • 9 static public members inherited from QObject
  • 2 protected functions inherited from Qt3DCore::QNode
  • 9 protected functions inherited from QObject

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)

Member Function Documentation

QMouseHandler::QMouseHandler(Qt3DCore::QNode *parent = nullptr)

Constructs a new QMouseHandler instance with parent parent.

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

Sets the mouse device of the QMouseHandler instance to mouseDevice.

Note: Setter function for property sourceDevice.

See also sourceDevice().