Qt3DInput::QActionInput Class

class Qt3DInput::QActionInput

QActionInput 存储用于触发输入事件的设备和按钮。更多

头文件: #include <QActionInput>
CMake.QActionInput find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
在 QML 中: ActionInput
继承: Qt3DInput::QAbstractActionInput
状态:已废弃

属性

公共功能

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)

Notifier 信号:

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 的通知信号。

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