QCustom3DLabel Class
La classe QCustom3DLabel aggiunge un'etichetta personalizzata a un grafico. Per saperne di più...
| Intestazione: | #include <QCustom3DLabel> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| In QML: | Custom3DLabel |
| Eredita da: | QCustom3DItem |
- Elenco di tutti i membri, compresi quelli ereditati
- QCustom3DLabel fa parte delle classi C++ "Qt Graphs " per il 3D.
Proprietà
|
Funzioni pubbliche
| 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 |
Segnali
| 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) |
Descrizione dettagliata
È possibile impostare il testo, il carattere, la posizione, il ridimensionamento, la rotazione e i colori di un'etichetta personalizzata. Inoltre, è possibile attivare o disattivare la visibilità dei bordi e dello sfondo dell'etichetta. I colori, i bordi e lo sfondo sono determinati dal tema attivo, a meno che non vengano impostati esplicitamente.
Nota: nel ridimensionamento, la coordinata z non ha alcun effetto. Impostando le stesse coordinate x e y si mantengono le dimensioni originali del carattere.
Vedi anche Q3DGraphsWidgetItem::addCustomItem().
Documentazione delle proprietà
backgroundColor : QColor
Questa proprietà definisce il colore dello sfondo dell'etichetta, se abilitata.
Il valore predefinito è Qt::gray.
Funzioni di accesso:
| QColor | backgroundColor() const |
| void | setBackgroundColor(QColor color) |
Segnale di notifica:
| void | backgroundColorChanged(QColor color) |
Vedi anche backgroundVisible.
backgroundVisible : bool
Questa proprietà determina se lo sfondo dell'etichetta è visibile.
Se impostata su ` false`, la funzione ` backgroundColor()` non ha alcun effetto. Il valore predefinito è ` true`.
Funzioni di accesso:
| bool | isBackgroundVisible() const |
| void | setBackgroundVisible(bool visible) |
Segnale di notifica:
| void | backgroundVisibleChanged(bool visible) |
borderVisible : bool
Questa proprietà determina se i bordi delle etichette sono visibili.
Il valore predefinito è " true".
Funzioni di accesso:
| bool | isBorderVisible() const |
| void | setBorderVisible(bool visible) |
Segnale di notifica:
| void | borderVisibleChanged(bool visible) |
facingCamera : bool
Questa proprietà determina se l'etichetta sarà sempre rivolta verso la fotocamera.
Il valore predefinito è false. Se impostato su true, rotation() non ha alcun effetto.
Funzioni di accesso:
| bool | isFacingCamera() const |
| void | setFacingCamera(bool enabled) |
Segnale di notifica:
| void | facingCameraChanged(bool enabled) |
font : QFont
Questa proprietà specifica il tipo di carattere da utilizzare per l'etichetta.
Il valore predefinito è " QFont("Arial", 20)". La formattazione speciale (ad esempio, con contorno) non è supportata.
Funzioni di accesso:
| QFont | font() const |
| void | setFont(const QFont &font) |
Segnale di notifica:
| void | fontChanged(const QFont &font) |
text : QString
Questa proprietà contiene il testo dell'etichetta.
Il testo formattato non è supportato.
Funzioni di accesso:
| QString | text() const |
| void | setText(const QString &text) |
Segnale di notifica:
| void | textChanged(const QString &text) |
textColor : QColor
Questa proprietà definisce il colore del testo dell'etichetta.
Influisce anche sul bordo dell'etichetta, se abilitato. Il valore predefinito è Qt::white.
Funzioni di accesso:
| QColor | textColor() const |
| void | setTextColor(QColor color) |
Segnale di notifica:
| void | textColorChanged(QColor color) |
Vedi anche borderVisible.
Documentazione delle funzioni membro
[explicit] QCustom3DLabel::QCustom3DLabel(QObject *parent = nullptr)
Crea un'etichetta 3D personalizzata utilizzando l'parent specificato.
[explicit] QCustom3DLabel::QCustom3DLabel(const QString &text, const QFont &font, QVector3D position, QVector3D scaling, const QQuaternion &rotation, QObject *parent = nullptr)
Crea un'etichetta 3D personalizzata con i seguenti parametri: text, font, position, scaling, rotation e, facoltativamente, parent.
Nota: impostando le stesse coordinate x e y per scaling si mantengono le dimensioni originali del font.
[override virtual noexcept] QCustom3DLabel::~QCustom3DLabel()
Elimina l'etichetta 3D personalizzata.
© 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.