Qt3DExtras::QExtrudedTextGeometry Class

class Qt3DExtras::QExtrudedTextGeometry

QExtrudedTextGeometry 类允许在三维空间中创建三维挤出文本。更多

Header: #include <Qt3DExtras/QExtrudedTextGeometry>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
在 QML 中: ExtrudedTextGeometry
继承: Qt3DCore::QGeometry
状态:已废弃

属性

公共功能

QExtrudedTextGeometry(Qt3DCore::QNode *parent = nullptr)
float extrusionLength() const
QFont font() const
Qt3DCore::QAttribute *indexAttribute() const
Qt3DCore::QAttribute *normalAttribute() const
Qt3DCore::QAttribute *positionAttribute() const
QString text() const

公共插槽

void setDepth(float extrusionLength)
void setFont(const QFont &font)
void setText(const QString &text)

信号

void depthChanged(float extrusionLength)
void fontChanged(const QFont &font)
void textChanged(const QString &text)

详细说明

QExtrudedTextGeometry 类最常用于 QText3DMesh 内部,但也可用于自定义Qt3DRender::QGeometryRenderer 子类。

几何体的原点是文本基线的左后方。

属性文档

extrusionLength : float

保存文本的挤出长度。

访问功能:

float extrusionLength() const
void setDepth(float extrusionLength)

通知信号:

void depthChanged(float extrusionLength)

font : QFont

保存文本的字体。

几何图形按字体的 pointSize 进行归一化处理,因此,pointSize 越大,文字越平滑,而不是越大。

访问功能:

QFont font() const
void setFont(const QFont &font)

Notifier 信号:

void fontChanged(const QFont &font)

[read-only] indexAttribute : Qt3DCore::QAttribute* const

保存几何体索引属性。

访问功能:

Qt3DCore::QAttribute *indexAttribute() const

[read-only] normalAttribute : Qt3DCore::QAttribute* const

保存几何体法线属性。

访问功能:

Qt3DCore::QAttribute *normalAttribute() const

[read-only] positionAttribute : Qt3DCore::QAttribute* const

保存几何体位置属性。

访问功能:

Qt3DCore::QAttribute *positionAttribute() const

text : QString

保存用于网格的文本。

访问功能:

QString text() const
void setText(const QString &text)

Notifier 信号:

void textChanged(const QString &text)

成员函数 文档

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

使用parent 构建一个新的 QExtrudedTextGeometry。

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