Auf dieser Seite

Qt3DExtras::QText2DEntity Class

class Qt3DExtras::QText2DEntity

Mit QText2DEntity lässt sich ein 2D-Text im 3D-Raum erstellen. Mehr...

Überschrift: #include <Qt3DExtras/QText2DEntity>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
In QML: Text2DEntity
Erbt von: Qt3DCore::QEntity
Status: Veraltet

Diese Klasse ist veraltet. Wir raten dringend davon ab, sie in neuem Code zu verwenden.

Eigenschaften

Öffentliche Funktionen

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

Signale

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

Detaillierte Beschreibung

Die QText2DEntity rendert Text als Dreiecke in der XY-Ebene. Die Geometrie wird in das Rechteck mit der angegebenen Breite und Höhe angepasst. Ist die resultierende Geometrie breiter als die angegebene Breite, wird der Rest in einer neuen Zeile gerendert.

Die Entität kann durch Hinzufügen einer Transformationskomponente in der Szene positioniert werden.

QText2DEntity erstellt eine Geometrie basierend auf der Form der Glyphen und ein festes Material unter Verwendung der angegebenen Farbe.

Dokumentation der Eigenschaften

alignment : Qt::Alignment

Gibt die Ausrichtung des Textelements zurück, das in der „ Qt Quick “-Szene angezeigt wird.

Die Standardausrichtung ist „oben links“.

Zugriffsfunktionen:

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

color : QColor

Enthält die Farbe für das Textelement, das in der Szene „ Qt Quick “ angezeigt wird.

Zugriffsfunktionen:

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

Notifier-Signal:

void colorChanged(const QColor &color)

font : QFont

Enthält die Schriftart für das Textelement, das in der Szene „ Qt Quick “ angezeigt wird.

Zugriffsfunktionen:

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

Notifier-Signal:

void fontChanged(const QFont &font)

height : float

Gibt die Höhe des Textelements zurück, das in der Szene „ Qt Quick “ angezeigt wird.

Zugriffsfunktionen:

float height() const
void setHeight(float height)

Notifier-Signal:

void heightChanged(float height)

text : QString

Enthält den Text, der in der Szene „ Qt Quick “ angezeigt wird.

Zugriffsfunktionen:

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

Notifier-Signal:

void textChanged(const QString &text)

width : float

Gibt die Breite des Textelements zurück, das in der Szene „ Qt Quick “ angezeigt wird.

Zugriffsfunktionen:

float width() const
void setWidth(float width)

Notifier-Signal:

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.