QMouseDevice Class

(Qt3DInput::QMouseDevice)

Delegates mouse events to the attached MouseHandler objects. More...

Header: #include <QMouseDevice>
qmake: QT += 3dinput
Since: Qt 5.5
Instantiated By: MouseDevice
Inherits: Qt3DInput::QAbstractPhysicalDevice

This class was introduced in Qt 5.5.

Public Types

enum Axis { X, Y, WheelX, WheelY }

Properties

Public Functions

QMouseDevice(Qt3DCore::QNode *parent = nullptr)
float sensitivity() const

Reimplemented Public Functions

virtual int axisCount() const override
virtual int axisIdentifier(const QString &name) const override
virtual QStringList axisNames() const override
virtual int buttonCount() const override
virtual int buttonIdentifier(const QString &name) const override
virtual QStringList buttonNames() const override

Public Slots

void setSensitivity(float value)

Signals

void sensitivityChanged(float value)
typedef QNodePtr
typedef QNodeVector
typedef QObjectList
QList<T> qFindChildren(const QObject *obj, const QRegExp &regExp)
Qt3DCore::QNodeId qIdForNode(Qt3DCore::QNode *node)
Qt3DCore::QNodeIdVector qIdsForNodes(const T &nodes)
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

A QMouseDevice delegates mouse events from physical mouse device to QMouseHandler objects. The sensitivity of the mouse can be controlled with the QMouseDevice::sensitivity property, which specifies the rate in which the logical mouse coordinates change in response to physical movement of the mouse.

See also QMouseHandler.

Member Type Documentation

enum QMouseDevice::Axis

The mouse axis.

ConstantValue
Qt3DInput::QMouseDevice::X0
Qt3DInput::QMouseDevice::Y1
Qt3DInput::QMouseDevice::WheelX2
Qt3DInput::QMouseDevice::WheelY3

See also Qt3DInput::QAnalogAxisInput::setAxis.

Property Documentation

sensitivity : float

Holds the sensitivity of the mouse device. The default is 0.1.

Access functions:

float sensitivity() const
void setSensitivity(float value)

Notifier signal:

void sensitivityChanged(float value)

Member Function Documentation

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

Constructs a new QMouseDevice instance with parent parent.

[override virtual] int QMouseDevice::axisCount() const

Reimplements: QAbstractPhysicalDevice::axisCount() const.

Returns the axis count.

Note: Currently always returns 4.

[override virtual] int QMouseDevice::axisIdentifier(const QString &name) const

Reimplements: QAbstractPhysicalDevice::axisIdentifier(const QString &name) const.

Convert axis name to axis identifier.

[override virtual] QStringList QMouseDevice::axisNames() const

Reimplements: QAbstractPhysicalDevice::axisNames() const.

Returns the names of the axis.

Note: Currently always returns StringList["X", "Y"]

[override virtual] int QMouseDevice::buttonCount() const

Reimplements: QAbstractPhysicalDevice::buttonCount() const.

Returns the button count.

Note: Currently always returns 3.

[override virtual] int QMouseDevice::buttonIdentifier(const QString &name) const

Reimplements: QAbstractPhysicalDevice::buttonIdentifier(const QString &name) const.

Returns the button identifier that corresponds with the specified name. The possible return values are documented in QMouseEvent::Buttons.

[override virtual] QStringList QMouseDevice::buttonNames() const

Reimplements: QAbstractPhysicalDevice::buttonNames() const.

Returns the names of the buttons.

Note: Currently always returns StringList["Left", "Right", "Center"]

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