HusLabel 文本标签
August 13, 2026 · View on GitHub
HusLabel 文本标签
扩展了HusText(文本)的功能, 并自带背景和圆角。
-
模块 { HuskarUI.Basic }
-
继承自 { Label }
支持的代理:
- 无
支持的属性:
| 属性名 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| colorText | color | - | 文本颜色 |
| colorBg | color | - | 背景颜色 |
| radiusBg | HusRadius | - | 背景圆角 |
| borderBg | HusBorder | - | 背景边框 |
| sizeHint | string | 'normal' | 尺寸提示 |
代码演示
示例 1
使用方法等同于 Label
import QtQuick
import HuskarUI.Basic
Column {
spacing: 15
Row {
HusText {
anchors.verticalCenter: parent.verticalCenter
text: 'Radius: '
}
HusSlider {
id: radiusSlider
width: 150
height: 30
min: 0
max: 30
value: 0
}
}
HusSwitch {
id: enabledSwitch
checked: true
text: 'Enabeld: '
}
HusLabel {
enabled: enabledSwitch.checked
text: qsTr('HusLabel文本')
radiusBg.all: radiusSlider.currentValue
}
}