QText2DEntity Class

class Qt3DExtras::QText2DEntity

QText2DEntity 允许在 3D 空间中创建 2D 文本. More...

属性

公有函数

QColor color() const
QFont font() const
float height() const
void setColor(const QColor &color)
void setFont(const QFont &font)
void setHeight(float height)
void setText(const QString &text)
void setWidth(float width)
QString text() const
float width() const

信号

void colorChanged(const QColor &color)
void fontChanged(const QFont &font)
void heightChanged(float height)
void textChanged(const QString &text)
void widthChanged(float width)

其他继承的成员

Detailed Description

QText2DEntity 将文本呈现为 XY 坐标平面中的三角形. 几何体将放置在指定宽度和高度的矩形中. 如果生成的几何图形比指定的宽度宽, 则其余部分将显示在新的一行.

通过添加变换组件, 可以在场景中定位实体.

QText2DEntity 将根据字形的形状和使用指定颜色的实体材料创建几何体.

属性

color : QColor

保存在 Qt Quick 场景中显示的文本项的颜色.

访问函数:

QColor color() const
void setColor(const QColor &color)

Notifier signal:

void colorChanged(const QColor &color)

font : QFont

保存在 Qt Quick 场景中显示的文本项的字体.

Access functions:

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

Notifier signal:

void fontChanged(const QFont &font)

height : float

返回在 Qt Quick 场景中显示的文本项的高度.

Access functions:

float height() const
void setHeight(float height)

Notifier signal:

void heightChanged(float height)

text : QString

保存在 Qt Quick 场景中显示的文本.

Access functions:

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

Notifier signal:

void textChanged(const QString &text)

width : float

返回在 Qt Quick 场景中显示的文本项的宽度.

Access functions:

float width() const
void setWidth(float width)

Notifier signal:

void widthChanged(float width)