QLinearProgress 组件显示彩色的加载条。进度条可以采用确定进度或不确定动画。它应该用于通知用户后台正在执行某个操作。
¥The QLinearProgress component displays a colored loading bar. The bar can either have a determinate progress or an indeterminate animation. It should be used to inform the user that an action is occurring in the background.
用法(Usage)
¥Usage
确定状态(Determined state)
¥Determined state
不确定状态(Indeterminate state)
¥Indeterminate state
提示
对于不确定状态(上文)或查询状态(下文),你无需指定 value
属性。
¥For indeterminate state (above) or query state (below) you don’t need to specify the value
property.
反转(Reversed)
¥Reversed
样式(Style)
¥Style
缓冲区(Buffer)
¥Buffer
使用标签(With a label)
¥With a label
要为进度条添加标签,你可以使用默认插槽。注意:
¥To add a label to the progress bar you can use the default slot. Take care to:
使用足够大的
size
以显示标签¥use a
size
big enough to allow showing the label设置标签的文本颜色,使其在填充区域和未填充区域均可见,或者使用 CSS 的 text-shadow,或者使用 QBadge,如下例所示。
¥set a text color for the label so that it is visible both on the filled and unfilled areas, or use text-shadow CSS, or use a QBadge as in the example below