PySide6.QtGraphs.QCustom3DLabel

class QCustom3DLabel

QCustom3DLabel 类向图表添加了一个自定义标签。更多

PySide6.QtGraphs.QCustom3DLabel 的继承图

概要

属性

方法

信号

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

可以设置自定义标签的文本、字体、位置、缩放、旋转和颜色。此外,可以切换标签边框和背景的可见性。除非明确设置,否则颜色、边框和背景由当前主题决定。

注意

在缩放过程中,z坐标没有影响。设置相同的x和y坐标可以保留原始字体尺寸。

另请参阅

addCustomItem()

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property backgroundColorᅟ: QColor

此属性保存标签背景的颜色(如果启用)。

默认为 Qt::gray

另请参阅

backgroundVisible

Access functions:
property backgroundVisibleᅟ: bool

此属性表示标签背景是否可见。

如果设置为falsebackgroundColor()将无效。默认为true

Access functions:
property borderVisibleᅟ: bool

此属性表示标签边框是否可见。

默认为 true

Access functions:
property facingCameraᅟ: bool

此属性表示标签是否始终面向相机。

默认为false。如果设置为truerotation()将无效。

Access functions:
property fontᅟ: QFont

此属性保存用于标签的字体。

默认为 QFont("Arial", 20)。不支持特殊格式(例如,轮廓)。

Access functions:
property textᅟ: str

此属性保存标签的文本。

不支持富文本。

Access functions:
property textColorᅟ: QColor

此属性保存标签文本的颜色。

如果启用,也会影响标签边框。默认为 Qt::white

另请参阅

borderVisible

Access functions:
__init__([parent=None])
Parameters:

父对象QObject

使用给定的parent构建一个自定义的3D标签。

__init__(text, font, position, scaling, rotation[, parent=None])
Parameters:

使用给定的textfontpositionscalingrotation和可选的parent构建一个自定义的3D标签。

注意

scaling设置相同的x和y坐标可以保留原始字体尺寸。

backgroundColor()
Return type:

QColor

另请参阅

setBackgroundColor()

获取属性 backgroundColorᅟ 的Getter。

backgroundColorChanged(color)
Parameters:

颜色QColor

属性 backgroundColorᅟ 的通知信号。

backgroundVisibleChanged(visible)
Parameters:

visible – 布尔值

属性 backgroundVisibleᅟ 的通知信号。

borderVisibleChanged(visible)
Parameters:

visible – 布尔值

属性 borderVisibleᅟ 的通知信号。

facingCameraChanged(enabled)
Parameters:

enabled – 布尔值

属性 facingCameraᅟ 的通知信号。

font()
Return type:

QFont

另请参阅

setFont()

属性 fontᅟ 的获取器。

fontChanged(font)
Parameters:

字体QFont

属性 fontᅟ 的通知信号。

isBackgroundVisible()
Return type:

布尔

属性 backgroundVisibleᅟ 的获取器。

isBorderVisible()
Return type:

布尔

属性 borderVisibleᅟ 的获取器。

isFacingCamera()
Return type:

布尔

获取属性 facingCameraᅟ 的Getter。

setBackgroundColor(color)
Parameters:

颜色QColor

另请参阅

backgroundColor()

属性 backgroundColorᅟ 的设置器。

setBackgroundVisible(visible)
Parameters:

visible – 布尔值

另请参阅

isBackgroundVisible()

属性 backgroundVisibleᅟ 的设置器。

setBorderVisible(visible)
Parameters:

visible – 布尔值

另请参阅

isBorderVisible()

属性 borderVisibleᅟ 的设置器。

setFacingCamera(enabled)
Parameters:

enabled – 布尔值

另请参阅

isFacingCamera()

属性 facingCameraᅟ 的设置器。

setFont(font)
Parameters:

字体QFont

另请参阅

font()

属性 fontᅟ 的设置器。

setText(text)
Parameters:

文本 – str

另请参阅

text()

属性 textᅟ 的设置器。

setTextColor(color)
Parameters:

颜色QColor

另请参阅

textColor()

属性 textColorᅟ 的设置器。

text()
Return type:

字符串

另请参阅

setText()

属性 textᅟ 的获取器。

textChanged(text)
Parameters:

文本 – str

属性 textᅟ 的通知信号。

textColor()
Return type:

QColor

另请参阅

setTextColor()

属性 textColorᅟ 的获取器。

textColorChanged(color)
Parameters:

颜色QColor

属性 textColorᅟ 的通知信号。