ProgressBar QML Type
指示操作的进度。更多
Import Statement: | import QtQuick.Controls |
Inherits: |
属性
- from : real
- indeterminate : bool
- position : real
- to : real
- value : real
- visualPosition : real
详细说明
ProgressBar 显示操作的进度。该值应定期更新。其范围由from 和to 定义,二者均可包含任何值。
ProgressBar { value: 0.5 }
ProgressBar 还支持一种特殊的indeterminate 模式,例如,在无法确定正在下载的项目的大小时,或在下载进度因网络断开而中断时,这种模式非常有用。
ProgressBar { indeterminate: true }
不确定模式类似于BusyIndicator 。两者都可以用来指示后台活动。两者的主要区别在于视觉上的不同,ProgressBar 也可以显示具体的进度(在可以确定的情况下)。由于视觉上的差异,不确定进度条和繁忙指示符在用户界面中的位置不同。不确定进度条的典型位置:
- 页面底部ToolBar
- 内嵌在Page
- 在ItemDelegate 中显示特定项目的进度
另请参阅 自定义进度条、BusyIndicator 和指示器控件。
属性文档
indeterminate : bool |
该属性显示进度条是否处于不确定模式。处于不确定模式的进度条会显示操作正在进行,但不会显示已取得了多少进度。
position : real |
该属性表示进度条的逻辑位置。
位置用数值的分数表示,范围为0.0 - 1.0
。为使进度可视化,应使用从右到左的visualPosition 。
另请参阅 value 和visualPosition 。
visualPosition : real |
© 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.