Custom3DLabel QML Type
为图表添加自定义标签。更多
Import Statement: | import QtGraphs |
In C++: | QCustom3DLabel |
Inherits: |
- 所有成员(包括继承成员)的列表
- Custom3DLabel 是Qt Graphs QML Types for 3D 的一部分。
属性
- backgroundColor : color
- backgroundVisible : bool
- borderVisible : bool
- facingCamera : bool
- font : font
- text : string
- textColor : color
信号
- backgroundColorChanged(color color)
- backgroundEnabledChanged(bool enabled)
- borderEnabledChanged(bool enabled)
- facingCameraChanged(bool enabled)
- fontChanged(font font)
- textChanged(string text)
- textColorChanged(color color)
详细说明
可以设置自定义标签的文本、字体、位置、缩放、旋转和颜色。此外,还可以切换标签边框和背景的可见性。除非明确设置,否则颜色、边框和背景由活动主题决定。
注意: 在缩放时,z 坐标不起作用。设置相同的 x 坐标和 y 坐标可保持字体的原始尺寸。
属性文档
backgroundColor : color |
标签背景颜色(如果启用)。默认为"gray"
。
另请参阅 backgroundVisible 。
backgroundVisible : bool |
定义标签背景是否可见。如果设置为false
,则backgroundColor 无效。默认为true
。
borderVisible : bool |
定义标签边框是否可见。默认为true
。
font : font |
标签使用的字体。默认为Font {family: "Arial"; pointSize: 20}
。不支持特殊格式(如轮廓)。
text : string |
标签文本。不支持富文本。
textColor : color |
标签文本的颜色。如果启用,也会影响标签边框。默认为"white"
。
另请参阅 borderVisible 。
信号 文档
backgroundColorChanged(color color) |
当backgroundColor 更改为color 时,将发出该信号。
注: 相应的处理程序是onBackgroundColorChanged
。
backgroundEnabledChanged(bool enabled) |
当 backgroundEnabled 更改为enabled 时发出此信号。
注: 相应的处理程序是onBackgroundEnabledChanged
。
borderEnabledChanged(bool enabled) |
当 borderEnabled 更改为enabled 时,将发出此信号。
注: 相应的处理程序是onBorderEnabledChanged
。
facingCameraChanged(bool enabled) |
当facingCamera 更改为enabled 时,将发出此信号。
注: 相应的处理程序是onFacingCameraChanged
。
© 2025 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.