ProgressBar QML Type

指示操作的进度。更多

Import Statement: import QtQuick.Controls
Inherits:

Control

属性

详细说明

ProgressBar 显示操作的进度。该值应定期更新。其范围由fromto 定义,二者均可包含任何值。

ProgressBar {
    value: 0.5
}

ProgressBar 还支持一种特殊的indeterminate 模式,例如,在无法确定正在下载的项目的大小时,或在下载进度因网络断开而中断时,这种模式非常有用。

ProgressBar {
    indeterminate: true
}

不确定模式类似于BusyIndicator 。两者都可以用来指示后台活动。两者的主要区别在于视觉上的不同,ProgressBar 也可以显示具体的进度(在可以确定的情况下)。由于视觉上的差异,不确定进度条和繁忙指示符在用户界面中的位置不同。不确定进度条的典型位置:

另请参阅 自定义进度条BusyIndicator指示器控件

属性文档

from : real

该属性用于保存进度条的起始值。默认值为0.0

另请参阅 tovalue


indeterminate : bool

该属性显示进度条是否处于不确定模式。处于不确定模式的进度条会显示操作正在进行,但不会显示已取得了多少进度。


position : real [read-only]

该属性表示进度条的逻辑位置。

位置用数值的分数表示,范围为0.0 - 1.0 。为使进度可视化,应使用从右到左的visualPosition

另请参阅 valuevisualPosition


to : real

该属性用于保存进度的结束值。默认值为1.0

另请参见 fromvalue


value : real

该属性用于保存进度值。默认值为0.0

另请参阅 from,to, 和position


visualPosition : real [read-only]

该属性用于保存进度的可视化位置。

位置以数值的分数表示,范围为0.0 - 1.0 。当控件为mirrored 时,visuaPosition 等于1.0 - position 。因此,考虑到从右到左的支持,visualPosition 适合用于进度的可视化。

另请参见 positionvalue


© 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.