QCustom3DLabel Class
Die Klasse „QCustom3DLabel“ fügt einem Diagramm eine benutzerdefinierte Beschriftung hinzu. Mehr...
| Header: | #include <QCustom3DLabel> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS DataVisualization) target_link_libraries(mytarget PRIVATE Qt6::DataVisualization) |
| qmake: | QT += datavisualization |
| Seit: | QtDataVisualization 1.1 |
| In QML: | Custom3DLabel |
| Erbt von: | QCustom3DItem |
| Status: | Veraltet |
Diese Klasse ist veraltet. Wir raten dringend davon ab, sie in neuem Code zu verwenden.
Eigenschaften
|
Öffentliche Funktionen
| QCustom3DLabel(QObject *parent = nullptr) | |
| QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position, const QVector3D &scaling, const QQuaternion &rotation, QObject *parent = 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 |
Signale
| 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) |
Ausführliche Beschreibung
Text, Schriftart, Position, Skalierung, Drehung und Farben einer benutzerdefinierten Beschriftung können festgelegt werden. Darüber hinaus lässt sich die Sichtbarkeit der Rahmen und des Hintergrunds der Beschriftung ein- und ausschalten. Farben, Rahmen und Hintergrund werden durch das aktive Design bestimmt, 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 „ QAbstract3DGraph::addCustomItem()“.
Dokumentation zu den Eigenschaften
backgroundColor : QColor
Diese Eigenschaft legt die Farbe für den Hintergrund der Beschriftung fest, sofern diese aktiviert ist.
Standardwert ist „ Qt::gray “.
Zugriffsfunktionen:
| QColor | backgroundColor() const |
| void | setBackgroundColor(const QColor &color) |
Notifier-Signal:
| void | backgroundColorChanged(const QColor &color) |
Siehe auch backgroundEnabled.
backgroundEnabled : bool
Diese Eigenschaft legt fest, ob der Hintergrund der Beschriftung aktiviert ist.
Ist der Wert auf „ false “ gesetzt, hat „ backgroundColor()“ keine Auswirkung. Der Standardwert ist „ true “.
Zugriffsfunktionen:
| bool | isBackgroundEnabled() const |
| void | setBackgroundEnabled(bool enabled) |
Notifier-Signal:
| void | backgroundEnabledChanged(bool enabled) |
borderEnabled : bool
Diese Eigenschaft legt fest, ob die Rahmen der Beschriftungen aktiviert sind.
Standardwert ist „ true “.
Zugriffsfunktionen:
| bool | isBorderEnabled() const |
| void | setBorderEnabled(bool enabled) |
Notifier-Signal:
| void | borderEnabledChanged(bool enabled) |
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. Kontur) 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. Der Standardwert ist „ Qt::white “.
Zugriffsfunktionen:
| QColor | textColor() const |
| void | setTextColor(const QColor &color) |
Benachrichtigungssignal:
| void | textColorChanged(const QColor &color) |
Siehe auch borderEnabled.
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, const QVector3D &position, const 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 Wert „ parent “.
Hinweis: Wenn Sie für „ scaling “ dieselben x- und y-Koordinatenfestlegen , bleiben die ursprünglichen Schriftgrößen erhalten.
[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.