QPaintEvent Class Reference

#include <qevent.h>

Inheritance diagram for QPaintEvent:

Inheritance graph
[legend]
Collaboration diagram for QPaintEvent:

Collaboration graph
[legend]
List of all members.

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(), QWidget::paintEvent()

Definition at line 261 of file qevent.h.

Public Member Functions

 QPaintEvent (const QRegion &paintRegion)
 QPaintEvent (const QRect &paintRect)
 ~QPaintEvent ()
const QRectrect () const
const QRegionregion () const

Protected Attributes

QRect m_rect
QRegion m_region
bool m_erased

Friends

class QApplication
class QCoreApplication


Constructor & Destructor Documentation

QPaintEvent::QPaintEvent ( const QRegion paintRegion  ) 

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

Definition at line 1021 of file qevent.cpp.

01022     : QEvent(Paint), m_rect(paintRegion.boundingRect()), m_region(paintRegion), m_erased(false)
01023 {}

QPaintEvent::QPaintEvent ( const QRect paintRect  ) 

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

Definition at line 1029 of file qevent.cpp.

01030     : QEvent(Paint), m_rect(paintRect),m_region(paintRect), m_erased(false)
01031 {}

QPaintEvent::~QPaintEvent (  ) 

Definition at line 1049 of file qevent.cpp.

01050 {
01051 }


Member Function Documentation

const QRect & QPaintEvent::rect (  )  const [inline]

Returns the rectangle that needs to be updated.

See also:
region() QPainter::setClipRect()

Definition at line 268 of file qevent.h.

Referenced by Helper::paint(), QTextEditPrivate::paint(), QColorShowLabel::paintEvent(), QMenuBar::paintEvent(), Q3TableHeader::paintEvent(), ArthurFrame::paintEvent(), QHeaderView::paintEvent(), QDesignerDialog::paintEvent(), Oubliette::paintEvent(), QHideDock::paintEvent(), QListView::paintEvent(), QMenu::paintEvent(), Q3Header::paintEvent(), paintGrid(), and Q3ScrollView::viewportPaintEvent().

00268 { return m_rect; }

const QRegion & QPaintEvent::region (  )  const [inline]

Returns the region that needs to be updated.

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

Definition at line 269 of file qevent.h.

Referenced by Q3TableHeader::paintEvent(), qdesigner_internal::ConnectionEdit::paintEvent(), qdesigner_internal::TabOrderEditor::paintEvent(), and Q3ListBox::viewportPaintEvent().

00269 { return m_region; }


Friends And Related Function Documentation

friend class QApplication [friend]

Reimplemented from QEvent.

Definition at line 278 of file qevent.h.

friend class QCoreApplication [friend]

Reimplemented from QEvent.

Definition at line 279 of file qevent.h.


Member Data Documentation

QRect QPaintEvent::m_rect [protected]

Definition at line 280 of file qevent.h.

QRegion QPaintEvent::m_region [protected]

Definition at line 281 of file qevent.h.

bool QPaintEvent::m_erased [protected]

Definition at line 282 of file qevent.h.


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 18:37:06 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1