本页内容

Utils::ProgressIndicatorPainter Class

class Utils::ProgressIndicatorPainter

ProgressIndicatorPainter 类是ProgressIndicator 类的绘制后端。更多内容...

Header: #include <ProgressIndicatorPainter>

公共函数

ProgressIndicatorPainter(Utils::ProgressIndicatorSize size)
Utils::ProgressIndicatorSize indicatorSize() const
void setIndicatorSize(Utils::ProgressIndicatorSize size)
void setUpdateCallback(const Utils::ProgressIndicatorPainter::UpdateCallback &cb)
QSize size() const
void startAnimation()
void stopAnimation()

详细说明

您可以使用它将一个循环动画的圆形进度指示器直接绘制到QPaintDevice 上,例如,当您想显示进度指示器但无法使用QWidget 时。

成员函数文档

ProgressIndicatorPainter::ProgressIndicatorPainter(Utils::ProgressIndicatorSize size)

为进度指示器size 构建一个进度指示器绘制器。

另请参阅 setUpdateCallback 。

Utils::ProgressIndicatorSize ProgressIndicatorPainter::indicatorSize() const

返回当前指标的大小。使用size 可获取对应的像素大小。

另请参阅 setIndicatorSize 。

void ProgressIndicatorPainter::setIndicatorSize(Utils::ProgressIndicatorSize size)

将进度指示器的尺寸更改为size 。该类的用户需要根据生成的像素尺寸变化,相应调整其绘制或布局代码。

另请参阅 indicatorSize 和size 。

void ProgressIndicatorPainter::setUpdateCallback(const Utils::ProgressIndicatorPainter::UpdateCallback &cb)

设置回调函数 `cb `,当进度指示器因动画进展而需要重新绘制时,该回调函数会被调用。该回调函数是一个不带参数的 `void` 函数,通常应调用执行实际绘制的控件上的 `QWidget::update ` 方法。

QSize ProgressIndicatorPainter::size() const

返回进度指示器的尺寸(单位为设备无关像素)。

另请参阅 setIndicatorSize 和 paint。

void ProgressIndicatorPainter::startAnimation()

启动进度条动画。

另请参阅 setUpdateCallback 和stopAnimation 。

void ProgressIndicatorPainter::stopAnimation()

停止进度指示器的动画。

另请参阅 setUpdateCallback 和startAnimation 。

Copyright © The Qt Company Ltd. and other contributors. 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.