QPaintEvent(3qt)
π QPaintEvent π β aka QPaintEvent(3qt), the manual page for the cutest little event params in Qt 3
okay so. bestie. imagine a widget that needs to redraw itself. that's it. that's the whole vibe of this class. welcome to the group chat π
β¨ NAME β¨
QPaintEvent β event parameters for paint events π¨
πΈ SYNOPSIS πΈ
#include <qevent.h>
Inherits QEvent. yes she's a QEvent girlie, she's in the family π«Ά
π Public Members π
QPaintEvent ( const QRegion & paintRegion, bool erased = TRUE )
QPaintEvent ( const QRect & paintRect, bool erased = TRUE )
QPaintEvent ( const QRegion & paintRegion, const QRect & paintRect, bool erased = TRUE )
const QRect & rect () const
const QRegion & region () const
bool erased () const
three constructors, three getters, zero drama. iconic behavior honestly π
π¦ DESCRIPTION π¦
The QPaintEvent class contains event parameters for paint events. that's her whole job and she does it flawlessly β¨
Paint events get sent to widgets that need to update themselves β for instance when part of a widget is exposed because a covering widget is moved. so rude of that covering widget but okay π
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(). ngl that's just efficiency queen behavior. Painting is clipped to region() during processing of a paint event. no cap π―
The erased() function returns TRUE if the region() has been cleared to the widget's background (see QWidget::backgroundMode()), and FALSE if the region's contents are arbitrary. basically: "is this a clean slate or is it chaos" π
See also QPainter, QWidget::update(), QWidget::repaint(), QWidget::paintEvent(), QWidget::backgroundMode, QRegion, and Event Classes. the whole friend group π«
π MEMBER FUNCTION DOCUMENTATION π
QPaintEvent::QPaintEvent ( const QRegion & paintRegion, bool erased = TRUE )
Constructs a paint event object with the region that should be updated. The region is given by paintRegion. If erased is TRUE the region will be cleared before repainting. fresh start energy π
QPaintEvent::QPaintEvent ( const QRect & paintRect, bool erased = TRUE )
Constructs a paint event object with the rectangle that should be updated. The region is also given by paintRect. If erased is TRUE the region will be cleared before repainting. yep, the rect is the region here, don't overthink it bestie π
QPaintEvent::QPaintEvent ( const QRegion & paintRegion, const QRect & paintRect, bool erased = TRUE )
Constructs a paint event object with the rectangle paintRect that should be updated. The region is given by paintRegion. If erased is TRUE the region will be cleared before repainting. this is the "you give me both" version, high maintenance and we love her for it π
bool QPaintEvent::erased () const
Returns TRUE if the paint event region (or rectangle) has been erased with the widget's background; otherwise returns FALSE. simple. clean. a yes/no icon β
const QRect & QPaintEvent::rect () const
Returns the rectangle that should be updated.
See also region() and QPainter::setClipRect().
Examples:
okay so the original page lists an Examples section here and it is literally empty. no example code. nothing. an empty dance floor π not me keeping the heading anyway because the rules say every detail stays. so: Examples: β and that's all she wrote. π³οΈ
const QRegion & QPaintEvent::region () const
Returns the region that should be updated.
See also rect() and QPainter::setClipRegion().
Examples:
and again β Examples: with absolutely nothing under it. two empty example sections, twin ghosts π»π»
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. π
π AUTHOR π
Generated automatically from the source code. (so no, a human did not lovingly hand-craft this one β a script did, and honestly? respect π«‘)
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά (fr fr, good bug reports are the love language of maintainers)
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. β οΈ so yes β this whole man page is the "unofficial fan edit" of the docs, treat it accordingly
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qpaintevent.3qt) and the Qt version (3.3.8). don't be shy, include the deets, it's giving considerate π
and that's the whole page bestie!! π this one came from Trolltech AS, dated 2 February 2007, and it's the QPaintEvent(3qt) manual page from the Qt 3.3.8 era β go forth and repaint responsibly, mwah πβ¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms