Custom3DLabel QML Type
向图表添加自定义标签。更多...
| Import Statement: | import QtGraphs |
| In C++: | QCustom3DLabel |
| Inherits: |
- 所有成员列表,包括继承的成员
- Custom3DLabel 是Qt Graphs 3D QML 类型库的一部分。
属性
- 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 。
facingCamera : bool
指定标签是否始终朝向摄像头。默认值为false 。如果设置为true ,则rotation 将不起作用。
font : font
标签所使用的字体。默认值为Font {family: "Arial"; pointSize: 20} 。不支持特殊格式(例如,轮廓效果)。
text : string
标签的文本。不支持富文本。
textColor : color
标签文本的颜色。如果启用了标签边框,此颜色也会影响边框。默认值为"white" 。
另请参阅 borderVisible 。
Signal 文档
backgroundColorChanged(color color)
当backgroundColor 变为color 时,会触发此信号。
注意: 对应的处理程序 是onBackgroundColorChanged 。
backgroundEnabledChanged(bool enabled)
当 backgroundEnabled 的值变为enabled 时,会触发此信号。
注意: 相应的处理程序 为onBackgroundEnabledChanged 。
borderEnabledChanged(bool enabled)
当 borderEnabled 变为enabled 时,会触发此信号。
注意: 相应的处理程序 是onBorderEnabledChanged 。
facingCameraChanged(bool enabled)
当facingCamera 变为enabled 时,会触发此信号。
注意: 相应的处理程序 是onFacingCameraChanged 。
fontChanged(font font)
当font 变为font 时,会触发此信号。
注意: 相应的处理程序 是onFontChanged 。
textChanged(string text)
当text 变为text 时,会触发此信号。
注意: 相应的处理程序 是onTextChanged 。
textColorChanged(color color)
当textColor 变为color 时,会触发此信号。
注意: 相应的处理程序 是onTextColorChanged 。
© 2026 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.