QCustom3DLabel Class

The QCustom3DLabel class adds a custom label to a graph. More...

Header: #include <QCustom3DLabel>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
Since: QtDataVisualization 1.1
Instantiated By: Custom3DLabel
Inherits: QCustom3DItem

Properties

Public Functions

virtual ~QCustom3DLabel()
QColor backgroundColor() const
QFont font() const
bool isBackgroundEnabled() const
bool isBorderEnabled() const
bool isFacingCamera() const
void setBackgroundColor()
void setBackgroundEnabled()
void setBorderEnabled()
void setFacingCamera()
void setFont()
void setText()
void setTextColor()
QString text() const
QColor textColor() const

Signals

Detailed Description

The text, font, position, scaling, rotation, and colors of a custom label can be set. In addition, the visibility of the borders and background of the label can be toggled. Colors, borders, and background are determined by the active theme unless set explicitly.

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

See also QAbstract3DGraph::addCustomItem().

Property Documentation

backgroundColor : QColor

This property holds the color for the label background, if enabled.

Defaults to Qt::gray.

Access functions:

QColor backgroundColor() const
void setBackgroundColor()

Notifier signal:

void backgroundColorChanged()

See also backgroundEnabled.

backgroundEnabled : bool

This property holds whether the label background is enabled.

If set to false, backgroundColor() has no effect. Defaults to true.

Access functions:

bool isBackgroundEnabled() const
void setBackgroundEnabled()

Notifier signal:

void backgroundEnabledChanged()

borderEnabled : bool

This property holds whether label borders are enabled.

Defaults to true.

Access functions:

bool isBorderEnabled() const
void setBorderEnabled()

Notifier signal:

void borderEnabledChanged()

facingCamera : bool

This property holds whether the label will always face the camera.

Defaults to false. If set to true, rotation() has no effect.

Access functions:

bool isFacingCamera() const
void setFacingCamera()

Notifier signal:

void facingCameraChanged()

font : QFont

This property holds 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()

Notifier signal:

void fontChanged()

text : QString

This property holds the text for the label.

Rich text is not supported.

Access functions:

QString text() const
void setText()

Notifier signal:

void textChanged()

textColor : QColor

This property holds the color for the label text.

Also affects the label border, if enabled. Defaults to Qt::white.

Access functions:

QColor textColor() const
void setTextColor()

Notifier signal:

void textColorChanged()

See also borderEnabled.

Member Function Documentation

[virtual] QCustom3DLabel::~QCustom3DLabel()

Deletes the custom 3D label.