ProgressIndicatorPainter Class | Extending Qt Creator Manual

Extending Qt Creator Manual | ProgressIndicatorPainter

Extending Qt Creator Manual 4.6.0

# ProgressIndicatorPainter 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(ProgressIndicatorSize size)
virtual | ~ProgressIndicatorPainter() = default
ProgressIndicatorSize | indicatorSize() const
void | paint(QPainter &painter, const QRect &rect) const
virtual void | setIndicatorSize(ProgressIndicatorSize size)
void | setUpdateCallback(const UpdateCallback &cb)
QSize | size() const
void | startAnimation()
void | stopAnimation()

## Detailed Description

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

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(ProgressIndicatorSize size)

Constructs a progress indicator painter for the indicator size.

See also setUpdateCallback.

### `[default]` ProgressIndicatorPainter::~ProgressIndicatorPainter()

Destroys the instance of ProgressIndicatorPainter. The destructor is virtual.

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

### `[virtual]` void ProgressIndicatorPainter::setIndicatorSize(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 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.