ProgressIndicatorPainter Class

class Utils::ProgressIndicatorPainter

The ProgressIndicatorPainter class is the painting backend for the ProgressIndicator class. More...

Header: #include <ProgressIndicatorPainter>

Public Functions

ProgressIndicatorPainter(Utils::ProgressIndicatorSize size)
Utils::ProgressIndicatorSize indicatorSize() const
void paint(QPainter &painter, const QRect &rect) const
void setIndicatorSize(Utils::ProgressIndicatorSize size)
void setUpdateCallback(const Utils::ProgressIndicatorPainter::UpdateCallback &cb)
QSize size() const
void startAnimation()
void stopAnimation()

Detailed Description

You can use it to paint a circular, endlessly animated progress indicator directly onto a QPaintDevice, for example, if you want to show a progress indicator where you cannot use a QWidget.

Member Function Documentation

ProgressIndicatorPainter::ProgressIndicatorPainter(Utils::ProgressIndicatorSize size)

Constructs a progress indicator painter for the indicator size.

See also setUpdateCallback.

Utils::ProgressIndicatorSize ProgressIndicatorPainter::indicatorSize() const

Returns the current indicator size. Use size to get the resulting pixel size.

See also setIndicatorSize.

void ProgressIndicatorPainter::paint(QPainter &painter, const QRect &rect) const

Paints the progress indicator centered in the rect on the given painter.

See also size.

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

Changes the size of the progress indicator to size. Users of the class need to adapt their painting or layouting code to the change in resulting pixel size.

See also indicatorSize and size.

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

Sets the callback cb that is called whenever the progress indicator needs a repaint, because its animation progressed. The callback is a void function taking no parameters, and should usually trigger a QWidget::update on the widget that does the actual painting.

QSize ProgressIndicatorPainter::size() const

Returns the size of the progress indicator in device independent pixels.

See also setIndicatorSize and paint.

void ProgressIndicatorPainter::startAnimation()

Starts the progress indicator animation.

See also setUpdateCallback and stopAnimation.

void ProgressIndicatorPainter::stopAnimation()

Stops the progress indicator animation.

See also setUpdateCallback and startAnimation.

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