QCustom3DLabel Class
La clase QCustom3DLabel añade una etiqueta personalizada a un gráfico. Más...
| Cabecera: | #include <QCustom3DLabel> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs)target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| En QML: | Custom3DLabel |
| Hereda: | QCustom3DItem |
- Lista de todos los miembros, incluyendo los heredados
- QCustom3DLabel es parte de Qt Graphs C++ Classes for 3D.
Propiedades
|
Funciones públicas
| 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 |
Señales
| 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) |
Descripción detallada
Permite definir el texto, la fuente, la posición, la escala, la rotación y los colores de una etiqueta personalizada. Además, se puede cambiar la visibilidad de los bordes y el fondo de la etiqueta. Los colores, los bordes y el fondo están determinados por el tema activo a menos que se establezcan explícitamente.
Nota: En el escalado, la coordenada z no tiene ningún efecto. Si se establecen las mismas coordenadas x e y, se conservan las dimensiones originales de la fuente.
Véase también Q3DGraphsWidgetItem::addCustomItem().
Documentación de propiedades
backgroundColor : QColor
Esta propiedad contiene el color para el fondo de la etiqueta, si está activado.
Por defecto es Qt::gray.
Funciones de acceso:
| QColor | backgroundColor() const |
| void | setBackgroundColor(QColor color) |
Señal del notificador:
| void | backgroundColorChanged(QColor color) |
Véase también backgroundVisible.
backgroundVisible : bool
Esta propiedad indica si el fondo de la etiqueta es visible.
Si se establece en false, backgroundColor() no tiene ningún efecto. Por defecto es true.
Funciones de acceso:
| bool | isBackgroundVisible() const |
| void | setBackgroundVisible(bool visible) |
Señal del notificador:
| void | backgroundVisibleChanged(bool visible) |
borderVisible : bool
Esta propiedad indica si los bordes de las etiquetas son visibles.
Por defecto es true.
Funciones de acceso:
| bool | isBorderVisible() const |
| void | setBorderVisible(bool visible) |
Señal del notificador:
| void | borderVisibleChanged(bool visible) |
facingCamera : bool
Esta propiedad indica si la etiqueta estará siempre orientada hacia la cámara.
Por defecto es false. Si se establece en true, rotation() no tiene ningún efecto.
Funciones de acceso:
| bool | isFacingCamera() const |
| void | setFacingCamera(bool enabled) |
Señal del notificador:
| void | facingCameraChanged(bool enabled) |
font : QFont
Esta propiedad contiene la fuente que se utilizará para la etiqueta.
Por defecto es QFont("Arial", 20). No admite formatos especiales (por ejemplo, contorno).
Funciones de acceso:
| QFont | font() const |
| void | setFont(const QFont &font) |
Señal del notificador:
| void | fontChanged(const QFont &font) |
text : QString
Esta propiedad contiene el texto de la etiqueta.
No admite texto enriquecido.
Funciones de acceso:
| QString | text() const |
| void | setText(const QString &text) |
Señal del notificador:
| void | textChanged(const QString &text) |
textColor : QColor
Esta propiedad contiene el color del texto de la etiqueta.
También afecta al borde de la etiqueta, si está activado. Por defecto es Qt::white.
Funciones de acceso:
| QColor | textColor() const |
| void | setTextColor(QColor color) |
Señal del notificador:
| void | textColorChanged(QColor color) |
Véase también borderVisible.
Documentación de las funciones miembro
[explicit] QCustom3DLabel::QCustom3DLabel(QObject *parent = nullptr)
Construye una etiqueta 3D personalizada con la dirección parent.
[explicit] QCustom3DLabel::QCustom3DLabel(const QString &text, const QFont &font, QVector3D position, QVector3D scaling, const QQuaternion &rotation, QObject *parent = nullptr)
Construye una etiqueta 3D personalizada con los datos text, font, position, scaling, rotation, y parent opcional.
Nota: Si se establecen las mismas coordenadas x e y para scaling, se conservan las dimensiones originales de la fuente.
[override virtual noexcept] QCustom3DLabel::~QCustom3DLabel()
Borra la etiqueta 3D personalizada.
© 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.