|  | Home · All Classes · Modules

# QPaintEvent Class Reference
[QtGui module]

The QPaintEvent class contains event parameters for paint events. More...

Inherits QEvent.

### Methods

- __init__ (self, QRegion paintRegion)
- __init__ (self, QRect paintRect)
- __init__ (self, QPaintEvent other)
- QRect rect (self)
- QRegion region (self)

## Detailed Description

The QPaintEvent class contains event parameters for paint events.

Paint events are sent to widgets that need to update themselves, for instance when part of a widget is exposed because a covering widget was moved.

The event contains a region() that needs to be updated, and a rect() that is the bounding rectangle of that region. Both are provided because many widgets can't make much use of region(), and rect() can be much faster than region().boundingRect(). Painting is clipped to region() during the processing of a paint event.

See also QPainter, QWidget.update(), QWidget.repaint(), and QWidget.paintEvent().

## Method Documentation

### QPaintEvent.__init__ (self, QRegion paintRegion)

Constructs a paint event object with the region that needs to be updated. The region is specified by paintRegion.

### QPaintEvent.__init__ (self, QRect paintRect)

Constructs a paint event object with the rectangle that needs to be updated. The region is specified by paintRect.

### QPaintEvent.__init__ (self, QPaintEvent other)

### QRect QPaintEvent.rect (self)

Returns the rectangle that needs to be updated.

See also region() and QPainter.setClipRect().

### QRegion QPaintEvent.region (self)

Returns the region that needs to be updated.

See also rect() and QPainter.setClipRegion().