QText2DEntity Class | Qt 3D 5.13.0

Qt 5.13 | Qt 3D | C++ Classes | QText2DEntity

Qt 5.13.0 Reference Documentation

# QText2DEntity Class

(Qt3DExtras::QText2DEntity)

QText2DEntity allows creation of a 2D text in 3D space. More...

Header: | #include <Qt3DExtras/QText2DEntity>
qmake: | QT += 3dextras
Instantiated By: | Text2DEntity
Inherits: | Qt3DCore::QEntity

- List of all members, including inherited members
- Obsolete members

## Properties

- color : QColor
- font : QFont
- height : float

- text : QString
- width : float

- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

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

- 4 public functions inherited from Qt3DCore::QEntity
- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject

## Signals

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

- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject

## Related Non-Members

typedef | QComponentVector
typedef | QNodePtr
typedef | QNodeVector
typedef | QObjectList
QList<T> | qFindChildren(const QObject *obj, const QRegExp &regExp)
Qt3DCore::QNodeId | qIdForNode(Qt3DCore::QNode *node)
Qt3DCore::QNodeIdVector | qIdsForNodes(const T &nodes)
T | qobject_cast(QObject *object)
T | qobject_cast(const QObject *object)

## Macros

| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
| Q_CLASSINFO(Name, Value)
| Q_DISABLE_COPY(Class)
| Q_DISABLE_COPY_MOVE(Class)
| Q_DISABLE_MOVE(Class)
| Q_EMIT
| Q_ENUM(...)
| Q_ENUM_NS(...)
| Q_FLAG(...)
| Q_FLAG_NS(...)
| Q_GADGET
| Q_INTERFACES(...)
| Q_INVOKABLE
| Q_NAMESPACE
| Q_OBJECT
| Q_PROPERTY(...)
| Q_REVISION
| Q_SET_OBJECT_NAME(Object)
| Q_SIGNAL
| Q_SIGNALS
| Q_SLOT
| Q_SLOTS

### Additional Inherited Members

- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject
- 9 static public members inherited from QObject
- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

## Detailed Description

The QText2DEntity renders text as triangles in the XY plane. The geometry will be fitted in the rectangle of specified width and height. If the resulting geometry is wider than the specified width, the remainder will be rendered on the new line.

The entity can be positionned in the scene by adding a transform component.

QText2DEntity will create geometry based on the shape of the glyphs and a solid material using the specified color.

## Property Documentation

### color : QColor

Holds the color for the text item that is displayed in the Qt Quick scene.

Access functions:

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

Notifier signal:

void | colorChanged(const QColor &color)

### font : QFont

Holds the font for the text item that is displayed in the Qt Quick scene.

Access functions:

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

Notifier signal:

void | fontChanged(const QFont &font)

### height : float

Returns the height of the text item that is displayed in the Qt Quick scene.

Access functions:

float | height() const
void | setHeight(float height)

Notifier signal:

void | heightChanged(float height)

### text : QString

Holds the text that is displayed in the Qt Quick scene.

Access functions:

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

Notifier signal:

void | textChanged(const QString &text)

### width : float

Returns the width of the text item that is displayed in the Qt Quick scene.

Access functions:

float | width() const
void | setWidth(float width)

Notifier signal:

void | widthChanged(float width)