Qt3DInput::QButtonAxisInput Class

class Qt3DInput::QButtonAxisInput

由按钮控制的轴输入 轴值由按钮而非操纵杆等传统模拟输入控制。更多

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

属性

公共功能

QButtonAxisInput(Qt3DCore::QNode *parent = nullptr)
float acceleration() const
QList<int> buttons() const
float deceleration() const
float scale() const

公共插槽

void setAcceleration(float acceleration)
void setButtons(const QList<int> &buttons)
void setDeceleration(float deceleration)
void setScale(float scale)

信号

void accelerationChanged(float acceleration)
void buttonsChanged(const QList<int> &buttons)
void decelerationChanged(float deceleration)
void scaleChanged(float scale)

详细说明

属性文档

acceleration : float

指定按住按钮时轴值的变化率

访问功能:

float acceleration() const
void setAcceleration(float acceleration)

提示信号:

void accelerationChanged(float acceleration)

buttons : QList<int>

指定控制轴的按钮

访问功能:

QList<int> buttons() const
void setButtons(const QList<int> &buttons)

提示信号:

void buttonsChanged(const QList<int> &buttons)

deceleration : float

指定释放按钮时轴值恢复正常的速率

访问功能:

float deceleration() const
void setDeceleration(float deceleration)

通知信号:

void decelerationChanged(float deceleration)

scale : float

指定轴输出值的缩放方式。默认情况下不应用缩放,因此默认为 1。

访问功能:

float scale() const
void setScale(float scale)

通知信号:

void scaleChanged(float scale)

成员函数 文档

[explicit] QButtonAxisInput::QButtonAxisInput(Qt3DCore::QNode *parent = nullptr)

使用parent 构建一个新的 QButtonAxisInput 实例。

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