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 DataVisualization) target_link_libraries(mytarget PRIVATE Qt6::DataVisualization) |
| qmake: | QT += datavisualization |
| A partire da: | QtDataVisualization 1.1 |
| In QML: | Custom3DLabel |
| Eredita da: | QCustom3DItem |
| Stato: | Obsoleta |
Questa classe è deprecata. Si sconsiglia vivamente di utilizzarla nel nuovo codice.
Proprietà
|
Funzioni pubbliche
| 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 |
Segnali
| 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) |
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 QAbstract3DGraph::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(const QColor &color) |
Segnale di notifica:
| void | backgroundColorChanged(const QColor &color) |
Vedi anche backgroundEnabled.
backgroundEnabled : bool
Questa proprietà determina se lo sfondo dell'etichetta è abilitato.
Se impostata su false, la funzione backgroundColor() non ha alcun effetto. Il valore predefinito è true.
Funzioni di accesso:
| bool | isBackgroundEnabled() const |
| void | setBackgroundEnabled(bool enabled) |
Segnale di notifica:
| void | backgroundEnabledChanged(bool enabled) |
borderEnabled : bool
Questa proprietà indica se i bordi delle etichette sono abilitati.
Il valore predefinito è " true".
Funzioni di accesso:
| bool | isBorderEnabled() const |
| void | setBorderEnabled(bool enabled) |
Segnale di notifica:
| void | borderEnabledChanged(bool enabled) |
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 carattere da utilizzare per l'etichetta.
Il valore predefinito è QFont("Arial", 20). La formattazione speciale (ad esempio, il 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(const QColor &color) |
Segnale di notifica:
| void | textColorChanged(const QColor &color) |
Vedi anche borderEnabled.
Documentazione delle funzioni membro
[explicit] QCustom3DLabel::QCustom3DLabel(QObject *parent = nullptr)
Crea un'etichetta 3D personalizzata con l'parent e specificata.
[explicit] QCustom3DLabel::QCustom3DLabel(const QString &text, const QFont &font, const QVector3D &position, const 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.
[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.