PySide6.QtGraphs.QCustom3DLabel¶
- class QCustom3DLabel¶
QCustom3DLabel
类向图表添加了一个自定义标签。更多…概要¶
属性¶
backgroundColorᅟ
- 如果启用,标签背景的颜色backgroundVisibleᅟ
- 标签背景是否可见borderVisibleᅟ
- 标签边框是否可见facingCameraᅟ
- 标签是否始终面向相机fontᅟ
- 用于标签textᅟ
- 用于标签textColorᅟ
- 标签文本的颜色
方法¶
def
__init__()
def
font()
def
isFacingCamera()
def
setFont()
def
setText()
def
setTextColor()
def
text()
def
textColor()
信号¶
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
可以设置自定义标签的文本、字体、位置、缩放、旋转和颜色。此外,可以切换标签边框和背景的可见性。除非明确设置,否则颜色、边框和背景由当前主题决定。
注意
当使用
from __feature__ import true_property
时,属性可以直接使用,否则通过访问器函数使用。此属性保存标签背景的颜色(如果启用)。
默认为
Qt::gray
。另请参阅
backgroundVisible
- Access functions:
- property backgroundVisibleᅟ: bool¶
此属性表示标签背景是否可见。
如果设置为
false
,backgroundColor()
将无效。默认为true
。- Access functions:
- property borderVisibleᅟ: bool¶
此属性表示标签边框是否可见。
默认为
true
。- Access functions:
- property facingCameraᅟ: bool¶
此属性表示标签是否始终面向相机。
默认为
false
。如果设置为true
,rotation()
将无效。- Access functions:
此属性保存用于标签的字体。
默认为
QFont("Arial", 20)
。不支持特殊格式(例如,轮廓)。- Access functions:
- property textᅟ: str¶
此属性保存标签的文本。
不支持富文本。
- Access functions:
此属性保存标签文本的颜色。
如果启用,也会影响标签边框。默认为
Qt::white
。另请参阅
borderVisible
- Access functions:
使用给定的
parent
构建一个自定义的3D标签。- __init__(text, font, position, scaling, rotation[, parent=None])
- Parameters:
文本 – str
字体 –
QFont
position –
QVector3D
缩放 –
QVector3D
rotation –
QQuaternion
parent –
QObject
使用给定的
text
、font
、position
、scaling
、rotation
和可选的parent
构建一个自定义的3D标签。注意
为
scaling
设置相同的x和y坐标可以保留原始字体尺寸。- backgroundColor()¶
- Return type:
另请参阅
获取属性
backgroundColorᅟ
的Getter。属性
backgroundColorᅟ
的通知信号。- backgroundVisibleChanged(visible)¶
- Parameters:
visible – 布尔值
属性
backgroundVisibleᅟ
的通知信号。- borderVisibleChanged(visible)¶
- Parameters:
visible – 布尔值
属性
borderVisibleᅟ
的通知信号。- facingCameraChanged(enabled)¶
- Parameters:
enabled – 布尔值
属性
facingCameraᅟ
的通知信号。属性
fontᅟ
的获取器。属性
fontᅟ
的通知信号。- isBackgroundVisible()¶
- Return type:
布尔
属性
backgroundVisibleᅟ
的获取器。- isBorderVisible()¶
- Return type:
布尔
属性
borderVisibleᅟ
的获取器。- isFacingCamera()¶
- Return type:
布尔
获取属性
facingCameraᅟ
的Getter。属性
backgroundColorᅟ
的设置器。- setBackgroundVisible(visible)¶
- Parameters:
visible – 布尔值
属性
backgroundVisibleᅟ
的设置器。- setBorderVisible(visible)¶
- Parameters:
visible – 布尔值
另请参阅
属性
borderVisibleᅟ
的设置器。- setFacingCamera(enabled)¶
- Parameters:
enabled – 布尔值
另请参阅
属性
facingCameraᅟ
的设置器。属性
fontᅟ
的设置器。属性
textᅟ
的设置器。属性
textColorᅟ
的设置器。属性
textᅟ
的获取器。- textChanged(text)¶
- Parameters:
文本 – str
属性
textᅟ
的通知信号。- textColor()¶
- Return type:
另请参阅
属性
textColorᅟ
的获取器。属性
textColorᅟ
的通知信号。