The QCustom3DLabel class adds a custom label to a graph. 更多...
| 頭: | #include <QCustom3DLabel> |
| Since: | QtDataVisualization 1.1 |
| 實例化: | Custom3DLabel |
| 繼承: | QCustom3DItem |
|
| 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 |
| 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 ) |
| const QMetaObject | staticMetaObject |
The QCustom3DLabel class adds a custom label to a graph.
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.
另請參閱 QAbstract3DGraph::addCustomItem ().
This property holds the color for the label background, if enabled.
默認為
Qt::gray
.
訪問函數:
| QColor | backgroundColor () const |
| void | setBackgroundColor (const QColor & color ) |
通知程序信號:
| void | backgroundColorChanged (const QColor & color ) |
另請參閱 backgroundEnabled .
此特性保持是否啓用標簽背景。
若設為
false
,
backgroundColor
() 不起作用。默認為
true
.
訪問函數:
| bool | isBackgroundEnabled () const |
| void | setBackgroundEnabled (bool enabled ) |
通知程序信號:
| void | backgroundEnabledChanged (bool enabled ) |
This property holds whether label borders are enabled.
默認為
true
.
訪問函數:
| bool | isBorderEnabled () const |
| void | setBorderEnabled (bool enabled ) |
通知程序信號:
| void | borderEnabledChanged (bool enabled ) |
This property holds whether the label will always face the camera.
默認為
false
。若設為
true
,
rotation
() has no effect.
訪問函數:
| bool | isFacingCamera () const |
| void | setFacingCamera (bool enabled ) |
通知程序信號:
| void | facingCameraChanged (bool enabled ) |
This property holds the font to be used for the label.
默認為
QFont("Arial", 20)
. Special formatting (for example, outlined) is not supported.
訪問函數:
| QFont | font () const |
| void | setFont (const QFont & font ) |
通知程序信號:
| void | fontChanged (const QFont & font ) |
This property holds the text for the label.
Rich text is not supported.
訪問函數:
| QString | text () const |
| void | setText (const QString & text ) |
通知程序信號:
| void | textChanged (const QString & text ) |
This property holds the color for the label text.
Also affects the label border, if enabled. Defaults to
Qt::white
.
訪問函數:
| QColor | textColor () const |
| void | setTextColor (const QColor & color ) |
通知程序信號:
| void | textColorChanged (const QColor & color ) |
另請參閱 borderEnabled .
Constructs a custom 3D label with the given parent .
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.
[虛擬]
QCustom3DLabel::
~QCustom3DLabel
()
Deletes the custom 3D label.