Auf dieser Seite

QCustom3DLabel Class

Die Klasse „QCustom3DLabel“ fügt einem Diagramm eine benutzerdefinierte Beschriftung hinzu. Mehr...

Header: #include <QCustom3DLabel>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: QT += graphs
In QML: Custom3DLabel
Erbt von: QCustom3DItem

Eigenschaften

Öffentliche Funktionen

QCustom3DLabel(QObject *parent = nullptr)
QCustom3DLabel(const QString &text, const QFont &font, QVector3D position, QVector3D scaling, const QQuaternion &rotation, QObject *parent = nullptr)
virtual ~QCustom3DLabel() override
QColor backgroundColor() const
QFont font() const
bool isBackgroundVisible() const
bool isBorderVisible() const
bool isFacingCamera() const
void setBackgroundColor(QColor color)
void setBackgroundVisible(bool visible)
void setBorderVisible(bool visible)
void setFacingCamera(bool enabled)
void setFont(const QFont &font)
void setText(const QString &text)
void setTextColor(QColor color)
QString text() const
QColor textColor() const

Signale

void backgroundColorChanged(QColor color)
void backgroundVisibleChanged(bool visible)
void borderVisibleChanged(bool visible)
void facingCameraChanged(bool enabled)
void fontChanged(const QFont &font)
void textChanged(const QString &text)
void textColorChanged(QColor color)

Detaillierte Beschreibung

Text, Schriftart, Position, Skalierung, Drehung und Farben einer benutzerdefinierten Beschriftung können festgelegt werden. Außerdem kann die Sichtbarkeit der Rahmen und des Hintergrunds der Beschriftung ein- und ausgeschaltet werden. Farben, Rahmen und Hintergrund richten sich nach dem aktiven Design, sofern sie nicht explizit festgelegt werden.

Hinweis: Bei der Skalierung hat die z-Koordinate keine Auswirkung. Durch die Festlegung identischer x- und y-Koordinaten bleiben die ursprünglichen Schriftgrößen erhalten.

Siehe auch „ Q3DGraphsWidgetItem::addCustomItem()“.

Dokumentation zu den Eigenschaften

backgroundColor : QColor

Diese Eigenschaft legt die Farbe für den Hintergrund der Beschriftung fest, sofern diese Option aktiviert ist.

Standardwert ist „ Qt::gray “.

Zugriffsfunktionen:

QColor backgroundColor() const
void setBackgroundColor(QColor color)

Notifier-Signal:

void backgroundColorChanged(QColor color)

Siehe auch backgroundVisible.

backgroundVisible : bool

Diese Eigenschaft legt fest, ob der Hintergrund der Beschriftung sichtbar ist.

Ist der Wert auf „ false “ gesetzt, hat „ backgroundColor()“ keine Wirkung. Der Standardwert ist „ true “.

Zugriffsfunktionen:

bool isBackgroundVisible() const
void setBackgroundVisible(bool visible)

Notifier-Signal:

void backgroundVisibleChanged(bool visible)

borderVisible : bool

Diese Eigenschaft legt fest, ob die Rahmen der Beschriftungen sichtbar sind.

Standardwert ist „ true “.

Zugriffsfunktionen:

bool isBorderVisible() const
void setBorderVisible(bool visible)

Notifier-Signal:

void borderVisibleChanged(bool visible)

facingCamera : bool

Diese Eigenschaft legt fest, ob das Etikett stets zur Kamera ausgerichtet ist.

Die Standardeinstellung ist „ false “. Wenn „ true “ festgelegt ist, hat „ rotation()“ keine Auswirkung.

Zugriffsfunktionen:

bool isFacingCamera() const
void setFacingCamera(bool enabled)

Notifier-Signal:

void facingCameraChanged(bool enabled)

font : QFont

Diese Eigenschaft legt die für die Beschriftung zu verwendende Schriftart fest.

Standardmäßig ist „ QFont("Arial", 20) “ eingestellt. Spezielle Formatierungen (z. B. Umrisse) werden nicht unterstützt.

Zugriffsfunktionen:

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

Benachrichtigungssignal:

void fontChanged(const QFont &font)

text : QString

Diese Eigenschaft enthält den Text für die Beschriftung.

Rich Text wird nicht unterstützt.

Zugriffsfunktionen:

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

Benachrichtigungssignal:

void textChanged(const QString &text)

textColor : QColor

Diese Eigenschaft legt die Farbe für den Beschriftungstext fest.

Beeinflusst auch den Rahmen der Beschriftung, sofern dieser aktiviert ist. Standardwert ist „ Qt::white “.

Zugriffsfunktionen:

QColor textColor() const
void setTextColor(QColor color)

Benachrichtigungssignal:

void textColorChanged(QColor color)

Siehe auch borderVisible.

Dokumentation der Mitgliedsfunktionen

[explicit] QCustom3DLabel::QCustom3DLabel(QObject *parent = nullptr)

Erstellt ein benutzerdefiniertes 3D-Etikett mit dem angegebenen „ parent “.

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

Erstellt ein benutzerdefiniertes 3D-Label mit den angegebenen Werten für „ text “, „ font “, „ position “, „ scaling “, „ rotation “ und dem optionalen „ parent “.

Hinweis: Wenn Sie für „ scaling “ dieselben x- und y-Koordinatenfestlegen , bleiben die ursprünglichen Schriftgrößen erhalten.

[override virtual noexcept] QCustom3DLabel::~QCustom3DLabel()

Löscht die benutzerdefinierte 3D-Beschriftung.

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