把鼠标事件委托给附加的 MouseHandler 对象。 更多...
头: | #include <QMouseDevice> |
CMake: |
find_package(Qt6 COMPONENTS 3dinput REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::3dinput) |
qmake: | QT += 3dinput |
Since: | Qt 5.5 |
实例化: | MouseDevice |
继承: | Qt3DInput::QAbstractPhysicalDevice |
enum | Axis { X, Y, WheelX, WheelY } |
QMouseDevice (Qt3DCore::QNode * parent = nullptr) | |
float | sensitivity () const |
bool | updateAxesContinuously () const |
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 |
void | setSensitivity (float value ) |
void | setUpdateAxesContinuously (bool updateAxesContinuously ) |
void | sensitivityChanged (float value ) |
void | updateAxesContinuouslyChanged (bool updateAxesContinuously ) |
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.
另请参阅 QMouseHandler .
The mouse axis.
常量 | 值 |
---|---|
Qt3DInput::QMouseDevice::X
|
0
|
Qt3DInput::QMouseDevice::Y
|
1
|
Qt3DInput::QMouseDevice::WheelX
|
2
|
Qt3DInput::QMouseDevice::WheelY
|
3
|
另请参阅 Qt3DInput::QAnalogAxisInput::setAxis .
Holds the sensitivity of the mouse device. The default is 0.1.
访问函数:
float | sensitivity () const |
void | setSensitivity (float value ) |
通知程序信号:
void | sensitivityChanged (float value ) |
[since 5.15]
updateAxesContinuously
:
bool
若
true
, axes will be updated anytime they change regardless of whether any mouse button is being pressed. Otherwise, axes are updated only when one of the mouse buttons is being pressed.
默认值为
false
.
该特性在 Qt 5.15 引入。
访问函数:
bool | updateAxesContinuously () const |
void | setUpdateAxesContinuously (bool updateAxesContinuously ) |
通知程序信号:
void | updateAxesContinuouslyChanged (bool updateAxesContinuously ) |
Constructs a new QMouseDevice instance with parent parent .
[override virtual]
int
QMouseDevice::
axisCount
() const
重实现: QAbstractPhysicalDevice::axisCount () const.
Returns the axis count.
注意: Currently always returns 4.
[override virtual]
int
QMouseDevice::
axisIdentifier
(const
QString
&
name
) const
重实现: QAbstractPhysicalDevice::axisIdentifier (const QString &name) const.
Convert axis name to axis identifier.
[override virtual]
QStringList
QMouseDevice::
axisNames
() const
重实现: QAbstractPhysicalDevice::axisNames () const.
Returns the names of the axis.
注意: Currently always returns StringList["X", "Y"]
[override virtual]
int
QMouseDevice::
buttonCount
() const
重实现: QAbstractPhysicalDevice::buttonCount () const.
Returns the button count.
注意: Currently always returns 3.
[override virtual]
int
QMouseDevice::
buttonIdentifier
(const
QString
&
name
) const
重实现: 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
重实现: QAbstractPhysicalDevice::buttonNames () const.
Returns the names of the buttons.
注意: Currently always returns StringList["Left", "Right", "Center"]