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

Properties

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

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)

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

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.

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