本页内容

Qt3DInput::QWheelEvent Class

class Qt3DInput::QWheelEvent

QWheelEvent 类包含描述鼠标滚轮事件的参数。更多内容...

头文件: #include <Qt3DInput/QWheelEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
在 QML 中: WheelEvent
继承自: QObject
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

公共类型

enum Buttons { LeftButton, RightButton, MiddleButton, BackButton, NoButton }
enum Modifiers { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, KeypadModifier }

属性

  • modifiers : const Qt3DInput::QWheelEvent::Modifiers
  • x : const int
  • y : const int

公开活动

QWheelEvent(const QWheelEvent &e)
QPoint angleDelta() const
int buttons() const
bool isAccepted() const
Qt3DInput::QWheelEvent::Modifiers modifiers() const
void setAccepted(bool accepted)
QEvent::Type type() const
int x() const
int y() const

详细说明

当鼠标滚轮转动时,会触发鼠标滚轮事件。

另请参阅 QKeyEvent 、QMouseEvent 和QMouseHandler 。

成员类型文档

enum QWheelEvent::Buttons

常数值
Qt3DInput::QWheelEvent::LeftButtonQt::LeftButton
Qt3DInput::QWheelEvent::RightButtonQt::RightButton
Qt3DInput::QWheelEvent::MiddleButtonQt::MiddleButton
Qt3DInput::QWheelEvent::BackButtonQt::BackButton
Qt3DInput::QWheelEvent::NoButtonQt::NoButton

enum QWheelEvent::Modifiers

常量值
Qt3DInput::QWheelEvent::NoModifierQt::NoModifier
Qt3DInput::QWheelEvent::ShiftModifierQt::ShiftModifier
Qt3DInput::QWheelEvent::ControlModifierQt::ControlModifier
Qt3DInput::QWheelEvent::AltModifierQt::AltModifier
Qt3DInput::QWheelEvent::MetaModifierQt::MetaModifier
Qt3DInput::QWheelEvent::KeypadModifierQt::KeypadModifier

属性文档

accepted : bool

指定鼠标滚轮事件是否已被接受

访问函数:

bool isAccepted() const
void setAccepted(bool accepted)

[read-only] angleDelta : const QPoint

指定鼠标滚轮事件的滚轮角度变化量

访问函数:

QPoint angleDelta() const

[read-only] buttons : const int

指定鼠标滚轮事件中(若存在)的按钮

访问函数:

int buttons() const

[read-only] modifiers : const Qt3DInput::QWheelEvent::Modifiers

指定是否对鼠标滚轮事件应用了任何修饰符

访问函数:

Qt3DInput::QWheelEvent::Modifiers modifiers() const

[read-only] x : const int

指定鼠标滚轮事件的 X 坐标

访问函数:

int x() const

[read-only] y : const int

指定鼠标滚轮事件的 Y 坐标

访问函数:

int y() const

成员函数文档

[explicit] QWheelEvent::QWheelEvent(const QWheelEvent &e)

根据 QWheelEvent 的e ,创建一个新的 QWheelEvent 实例。

QPoint QWheelEvent::angleDelta() const

返回滚轮旋转的距离,单位为八分之一度。正值表示滚轮向前旋转(远离用户),负值表示滚轮向后旋转(朝向用户)。

注意: 这是属性 angleDelta 的获取 函数。

int QWheelEvent::buttons() const

返回一个位域,用于检查可能伴随滚轮事件的鼠标按钮状态。

注意: 这是属性 buttons 的获取 函数。

bool QWheelEvent::isAccepted() const

返回该事件是否已被接受。

注意: 这是属性accepted 的获取器 函数。

Qt3DInput::QWheelEvent::Modifiers QWheelEvent::modifiers() const

返回可能伴随滚轮事件的键盘修饰键。

注意: 这是属性 modifiers 的获取 函数。

void QWheelEvent::setAccepted(bool accepted)

如果accepted 为true,则将该事件标记为已接受。

注意:当 事件被接受后,将阻止其进一步传播到其他监听器。

注意: 这是属性accepted 的设置 函数。

另请参阅 isAccepted()。

QEvent::Type QWheelEvent::type() const

返回该事件的QEvent::Type 。

int QWheelEvent::x() const

返回鼠标事件的 x 坐标。

注意: 这是属性 x 的获取 函数。

int QWheelEvent::y() const

返回鼠标事件的 x 坐标。

注意: 这是属性 y 的获取 函数。

相关非成员

QWheelEventPtr

QWheelEvent 的共享指针。

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