Qt3DAnimation::QMorphTarget Class
class Qt3DAnimation::QMorphTarget一个为混合形状动画提供形态目标的类。更多内容...
| 标题: | #include <qmorphtarget.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake: | QT += 3danimation |
| 在 QML 中: | MorphTarget |
| 继承自: | QObject |
| 状态: | 技术预览 |
该类处于技术预览阶段,内容可能会发生变更。
属性
- attributeNames : QStringList
公共函数
| QMorphTarget(QObject *parent = nullptr) | |
| void | addAttribute(Qt3DCore::QAttribute *attribute) |
| QList<Qt3DCore::QAttribute *> | attributeList() const |
| QStringList | attributeNames() const |
| void | removeAttribute(Qt3DCore::QAttribute *attribute) |
| void | setAttributes(const QList<Qt3DCore::QAttribute *> &attributes) |
信号
| void | attributeNamesChanged(const QStringList &attributeNames) |
静态公共成员
| Qt3DAnimation::QMorphTarget * | fromGeometry(Qt3DCore::QGeometry *geometry, const QStringList &attributes) |
详细说明
Qt3DAnimation::QMorphTarget 类是一个便利类,它提供了一组QAttributes ,QMorphingAnimation 会利用这些对象对几何体进行动画处理。QMorphTarget也可以基于现有的Qt3DCore::QGeometry 创建。
属性文档
[read-only] attributeNames : QStringList
包含形态目标中包含的属性名称列表。
访问函数:
| QStringList | attributeNames() const |
通知信号:
| void | attributeNamesChanged(const QStringList &attributeNames) |
成员函数文档
[explicit] QMorphTarget::QMorphTarget(QObject *parent = nullptr)
根据给定的parent ,构建一个QMorphTarget对象。
void QMorphTarget::addAttribute(Qt3DCore::QAttribute *attribute)
在变形目标上添加一个attribute 。此前不得已在变形目标上添加过同名的属性。
QList<Qt3DCore::QAttribute *> QMorphTarget::attributeList() const
返回形态目标中包含的属性列表。
[static invokable] Qt3DAnimation::QMorphTarget *QMorphTarget::fromGeometry(Qt3DCore::QGeometry *geometry, const QStringList &attributes)
根据给定的geometry 中的attributes 返回一个变形目标。
注意:此 函数可通过元对象系统以及在 QML 中调用。参见Q_INVOKABLE 。
void QMorphTarget::removeAttribute(Qt3DCore::QAttribute *attribute)
从变形目标中移除一个attribute 。
void QMorphTarget::setAttributes(const QList<Qt3DCore::QAttribute *> &attributes)
将 `attributes ` 设置为形态目标。原有属性将被清空。
© 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.