Qt3DInput::QActionInput Class
class Qt3DInput::QActionInputQActionInput 存储了用于触发输入事件的设备(Device)和按钮(Buttons)。更多内容...
| 头文件: | #include <qactioninput.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dinput) target_link_libraries(mytarget PRIVATE Qt6::3dinput) |
| qmake: | QT += 3dinput |
| 在 QML 中: | ActionInput |
| 继承自: | Qt3DInput::QAbstractActionInput |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议不要在新代码中使用它。
属性
- buttons : QList<int>
- sourceDevice : Qt3DInput::QAbstractPhysicalDevice*
公共函数
| QActionInput(Qt3DCore::QNode *parent = nullptr) | |
| QList<int> | buttons() const |
| Qt3DInput::QAbstractPhysicalDevice * | sourceDevice() const |
公共槽位
| void | setButtons(const QList<int> &buttons) |
| void | setSourceDevice(Qt3DInput::QAbstractPhysicalDevice *sourceDevice) |
信号
| void | buttonsChanged(const QList<int> &buttons) |
| void | sourceDeviceChanged(Qt3DInput::QAbstractPhysicalDevice *sourceDevice) |
属性文档
buttons : QList<int>
包含可触发此操作的按钮。
访问函数:
| QList<int> | buttons() const |
| void | setButtons(const QList<int> &buttons) |
通知器信号:
| void | buttonsChanged(const QList<int> &buttons) |
sourceDevice : Qt3DInput::QAbstractPhysicalDevice*
QActionInput 的电流源器件。
访问功能:
| Qt3DInput::QAbstractPhysicalDevice * | sourceDevice() const |
| void | setSourceDevice(Qt3DInput::QAbstractPhysicalDevice *sourceDevice) |
通知信号:
| void | sourceDeviceChanged(Qt3DInput::QAbstractPhysicalDevice *sourceDevice) |
成员函数文档
[explicit] QActionInput::QActionInput(Qt3DCore::QNode *parent = nullptr)
使用parent 创建一个新的QActionInput实例。
[signal] void QActionInput::buttonsChanged(const QList<int> &buttons)
当与该动作输入相关的按钮发生变化时,会触发此信号。发生变化的按钮包括buttons
注意: 这是属性buttons的通知器 信号。
[slot] void QActionInput::setButtons(const QList<int> &buttons)
将用于触发QActionInput 实例的按钮设置为buttons 。
注意: 这是属性buttons 的设置 函数。
另请参阅 buttons()。
[signal] void QActionInput::sourceDeviceChanged(Qt3DInput::QAbstractPhysicalDevice *sourceDevice)
当与操作输入关联的源设备被更改为sourceDevice 时,会发出此信号。
注意: 这是属性sourceDevice的通知器 信号。
© 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.