このページでは

Qt3DExtras::QText2DEntity Class

class Qt3DExtras::QText2DEntity

QText2DEntity を使用すると、3D 空間内に 2D テキストを作成できます。詳細...

ヘッダー: #include <Qt3DExtras/QText2DEntity>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
QML内では: Text2DEntity
継承元: Qt3DCore::QEntity
ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

プロパティ

パブリック関数

Qt::Alignment alignment() const
QColor color() const
QFont font() const
float height() const
void setAlignment(Qt::Alignment alignment)
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)

詳細な説明

QText2DEntity は、テキストを XY 平面上の三角形として描画します。ジオメトリは、指定された幅と高さの矩形内に収められます。結果として得られるジオメトリが指定された幅よりも広い場合、残りの部分は改行されて描画されます。

トランスフォームコンポーネントを追加することで、シーン内でのエンティティの位置を指定できます。

QText2DEntity は、グリフの形状に基づいてジオメトリを作成し、指定された色を使用したソリッドマテリアルを生成します。

プロパティのドキュメント

alignment : Qt::Alignment

Qt Quick シーンに表示されているテキスト項目の配置を返します。

デフォルトの配置は左上揃えです。

アクセス関数:

Qt::Alignment alignment() const
void setAlignment(Qt::Alignment alignment)

color : QColor

Qt Quick シーンに表示されるテキスト項目の色を保持します。

アクセス関数:

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

Notifierシグナル:

void colorChanged(const QColor &color)

font : QFont

Qt Quick シーンに表示されるテキスト項目のフォントを保持します。

アクセス関数:

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

Notifierシグナル:

void fontChanged(const QFont &font)

height : float

Qt Quick シーンに表示されているテキスト項目の高さを返します。

アクセス関数:

float height() const
void setHeight(float height)

通知シグナル:

void heightChanged(float height)

text : QString

Qt Quick シーンに表示されるテキストを保持します。

アクセス関数:

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

Notifierシグナル:

void textChanged(const QString &text)

width : float

Qt Quick シーンに表示されているテキスト項目の幅を返します。

アクセス関数:

float width() const
void setWidth(float width)

通知シグナル:

void widthChanged(float width)

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