IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QCustom3DLabel Class

The QCustom3DLabel class adds a custom label to a graph.

This class was introduced in QtDataVisualization 1.1.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QCustom3DLabel Class

  • Header: QCustom3DLabel

  • Since: QtDataVisualization 1.1

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS DataVisualization)

    target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)

  • qmake: QT += datavisualization

  • Inherited By:

  • Instantiated By: qml-qtdatavisualization-custom3dlabel.xml

  • Inherits: QCustom3DItem

Detailed Description

The text, font, position, scaling, rotation, and colors of a custom label can be set. In addition, the visibility of the borders and background of the label can be toggled. Colors, borders, and background are determined by the active theme unless set explicitly.

In scaling, the z-coordinate has no effect. Setting the same x- and y-coordinates retains the original font dimensions.

See Also

Property Documentation

 

backgroundColor : QColor

This property holds the color for the label background, if enabled.

Defaults to Qt::gray.

Access functions:

  • backgroundColor() const

  • void setBackgroundColor(const &color)

Notifier signal:

  • void backgroundColorChanged(const &color)

See Also

backgroundEnabled : bool

This property holds whether the label background is enabled.

If set to false, backgroundColor() has no effect. Defaults to true.

Access functions:

  • bool isBackgroundEnabled() const

  • void setBackgroundEnabled(bool enabled)

Notifier signal:

  • void backgroundEnabledChanged(bool enabled)

borderEnabled : bool

This property holds whether label borders are enabled.

Defaults to true.

Access functions:

  • bool isBorderEnabled() const

  • void setBorderEnabled(bool enabled)

Notifier signal:

  • void borderEnabledChanged(bool enabled)

facingCamera : bool

This property holds whether the label will always face the camera.

Defaults to false. If set to true, rotation() has no effect.

Access functions:

  • bool isFacingCamera() const

  • void setFacingCamera(bool enabled)

Notifier signal:

  • void facingCameraChanged(bool enabled)

font : QFont

This property holds the font to be used for the label.

Defaults to QFont("Arial", 20). Special formatting (for example, outlined) is not supported.

Access functions:

  • font() const

  • void setFont(const &font)

Notifier signal:

  • void fontChanged(const &font)

text : QString

This property holds the text for the label.

Rich text is not supported.

Access functions:

  • text() const

  • void setText(const &text)

Notifier signal:

  • void textChanged(const &text)

textColor : QColor

This property holds the color for the label text.

Also affects the label border, if enabled. Defaults to Qt::white.

Access functions:

  • textColor() const

  • void setTextColor(const &color)

Notifier signal:

  • void textColorChanged(const &color)

See Also

See also borderEnabled

Member Function Documentation

 

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

Constructs a custom 3D label with the given parent.

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

Constructs a custom 3D label with the given text, font, position, scaling, rotation, and optional parent.

Setting the same x- and y-coordinates for scaling retains the original font dimensions.

[virtual] QCustom3DLabel::~QCustom3DLabel()

Deletes the custom 3D label.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+