- Extending Qt Creator Manual
- ProgressIndicatorPainter
- Extending Qt Creator Manual 13.0.0

# ProgressIndicatorPainter Class

class Utils::ProgressIndicatorPainter

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

Header: | #include <ProgressIndicatorPainter>

- List of all members, including inherited members

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