CopperSpice API  1.7.2
QPaintEvent Class Reference

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

Inheritance diagram for QPaintEvent:
QEvent

Public Methods

 QPaintEvent (const QRect &paintRect)
 
 QPaintEvent (const QRegion &paintRegion)
 
const QRectrect () const
 
const QRegionregion () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Public Types inherited from QEvent
enum  Type
 
- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

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 not make much use of region(), and rect() can be much faster than region().boundingRect().

Automatic Clipping

Painting is clipped to region() during the processing of a paint event. This clipping is performed by the CopperSpice paint system and is independent of any clipping that may be applied to a QPainter used to draw on the paint device.

As a result, the value returned by QPainter::clipRegion() on a newly-constructed QPainter will not reflect the clip region that is used by the paint system.

See also
QPainter, QWidget::update(), QWidget::repaint(), QWidget::paintEvent()

Constructor & Destructor Documentation

QPaintEvent::QPaintEvent ( const QRegion paintRegion)
explicit

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

QPaintEvent::QPaintEvent ( const QRect paintRect)
explicit

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

Method Documentation

const QRect & QPaintEvent::rect ( ) const
inline

Returns the rectangle that needs to be updated.

See also
region(), QPainter::setClipRect()
const QRegion & QPaintEvent::region ( ) const
inline

Returns the region that needs to be updated.

See also
rect(), QPainter::setClipRegion()