Qt 5.7 | Qt Data Visualization | C++ Classes | QCustom3DLabel

Qt 5.7.1 Reference Documentation

# QCustom3DLabel Class

The QCustom3DLabel class is for creating custom labels to be added to a graph. More...

Header: | #include <QCustom3DLabel>
Since: | QtDataVisualization 1.1
Instantiated By: | Custom3DLabel
Inherits: | QCustom3DItem

- List of all members, including inherited members

## Properties

- backgroundColor : QColor
- backgroundEnabled : bool
- borderEnabled : bool
- facingCamera : bool

- font : QFont
- text : QString
- textColor : QColor

- 9 properties inherited from QCustom3DItem

## Public Functions

| QCustom3DLabel(QObject *parent = Q_NULLPTR)
| QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, QObject *parent = Q_NULLPTR)
virtual | ~QCustom3DLabel()
QColor | backgroundColor() const
QFont | font() const
bool | isBackgroundEnabled() const
bool | isBorderEnabled() const
bool | isFacingCamera() const
void | setBackgroundColor(const QColor &color)
void | setBackgroundEnabled(bool enabled)
void | setBorderEnabled(bool enabled)
void | setFacingCamera(bool enabled)
void | setFont(const QFont &font)
void | setText(const QString &text)
void | setTextColor(const QColor &color)
QString | text() const
QColor | textColor() const

- 20 public functions inherited from QCustom3DItem

## Signals

void | backgroundColorChanged(const QColor &color)
void | backgroundEnabledChanged(bool enabled)
void | borderEnabledChanged(bool enabled)
void | facingCameraChanged(bool enabled)
void | fontChanged(const QFont &font)
void | textChanged(const QString &text)
void | textColorChanged(const QColor &color)

- 9 signals inherited from QCustom3DItem

## Detailed Description

The QCustom3DLabel class is for creating custom labels to be added to a graph.

This class is for creating custom labels to be added to a graph. You can set text, font, position, scaling, rotation, and colors. You can also toggle borders and background for the label. Colors, borders and background are used from active theme unless any of them is set explicitly.

Note: In scaling, z has no effect. Setting the same x and y retains the original font dimensions.

See also QAbstract3DGraph::addCustomItem().

## Property Documentation

### backgroundColor : QColor

Color for the label background, if enabled. Defaults to `Qt::gray`.

Access functions:

QColor | backgroundColor() const
void | setBackgroundColor(const QColor &color)

Notifier signal:

void | backgroundColorChanged(const QColor &color)

See also backgroundEnabled.

### backgroundEnabled : bool

Enable label background. If set to `false`, backgroundColor() has no effect. Defaults to `true`.

Access functions:

bool | isBackgroundEnabled() const
void | setBackgroundEnabled(bool enabled)

Notifier signal:

void | backgroundEnabledChanged(bool enabled)

### borderEnabled : bool

Enable label borders. Defaults to `true`.

Access functions:

bool | isBorderEnabled() const
void | setBorderEnabled(bool enabled)

Notifier signal:

void | borderEnabledChanged(bool enabled)

### facingCamera : bool

Forces the label to face camera always. Defaults to `false`. If set to `true`, rotation() has no effect.

Access functions:

bool | isFacingCamera() const
void | setFacingCamera(bool enabled)

Notifier signal:

void | facingCameraChanged(bool enabled)

### font : QFont

The font to be used for the label. Defaults to `QFont("Arial", 20)`. Special formatting (for example outlined) is not supported.

Access functions:

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

Notifier signal:

void | fontChanged(const QFont &font)

### text : QString

The text for the label. Rich text is not supported.

Access functions:

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

Notifier signal:

void | textChanged(const QString &text)

### textColor : QColor

Color for the label text. Also affects label border, if enabled. Defaults to `Qt::white`.

Access functions:

QColor | textColor() const
void | setTextColor(const QColor &color)

Notifier signal:

void | textColorChanged(const QColor &color)

See also borderEnabled.

## Member Function Documentation

### QCustom3DLabel::QCustom3DLabel(QObject *parent = Q_NULLPTR)

Constructs QCustom3DLabel with given parent.

### QCustom3DLabel::QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, QObject *parent = Q_NULLPTR)

Constructs QCustom3DLabel with given text, font, position, scaling, rotation, and optional parent.

Note: Setting the same x and y for scaling retains the original font dimensions.

### `[virtual]` QCustom3DLabel::~QCustom3DLabel()

Destroys QCustom3DLabel.