QCustom3DLabel Class

The QCustom3DLabel class adds a custom label to a graph. 更多...

头文件: #include <QCustom3DLabel>
开始支持版本: QtDataVisualization 1.1
Instantiated By: Custom3DLabel
基类: QCustom3DItem

属性

公有函数

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

信号

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)

其他继承的成员

  • 1 个公有槽函数继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

The QCustom3DLabel class adds a custom label to a graph.

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.

参见 QAbstract3DGraph::addCustomItem().

属性

backgroundColor : QColor

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

Defaults to Qt::gray.

访问函数:

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

Notifier signal:

void backgroundColorChanged(const QColor &color)

参见 backgroundEnabled.

backgroundEnabled : bool

This property holds whether the label background is enabled.

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

访问函数:

bool isBackgroundEnabled() const
void setBackgroundEnabled(bool enabled)

Notifier signal:

void backgroundEnabledChanged(bool enabled)

borderEnabled : bool

This property holds whether label borders are enabled.

Defaults to true.

访问函数:

bool isBorderEnabled() const
void setBorderEnabled(bool enabled)

Notifier signal:

void borderEnabledChanged(bool enabled)

facingCamera : bool

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

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

访问函数:

bool isFacingCamera() const
void setFacingCamera(bool enabled)

Notifier signal:

void facingCameraChanged(bool enabled)

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.

访问函数:

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

Notifier signal:

void fontChanged(const QFont &font)

text : QString

This property holds the text for the label.

Rich text is not supported.

访问函数:

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

Notifier signal:

void textChanged(const QString &text)

textColor : QColor

This property holds the color for the label text.

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

访问函数:

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

Notifier signal:

void textColorChanged(const QColor &color)

参见 borderEnabled.

成员函数

QCustom3DLabel::QCustom3DLabel(QObject *parent = Q_NULLPTR)

Constructs a custom 3D label with the given parent.

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

Constructs a custom 3D label with the given text, font, position, scaling, rotation, and optional parent.

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

[virtual] QCustom3DLabel::~QCustom3DLabel()

Deletes the custom 3D label.