QPaintEvent 類

The QPaintEvent 類包含用於描繪事件的事件參數。 更多...

頭: #include <QPaintEvent>
繼承: QEvent

公共函數

QPaintEvent (const QRegion & paintRegion )
QPaintEvent (const QRect & paintRect )
const QRect & rect () const
const QRegion & region () const

額外繼承成員

詳細描述

The QPaintEvent 類包含用於描繪事件的事件參數。

描繪事件會被發送給需要更新自身的 Widget,例如:當由於覆蓋 Widget 被移動而暴露部分小部件時。

事件包含 region () 需要更新,和 rect () that is the bounding rectangle of that region. Both are provided because many widgets can't make much use of region (),和 rect () 可以更快相比 region ().boundingRect().

自動裁剪

描繪被裁剪到 region () 在描繪事件處理期間。此裁剪由 Qt 描繪係統履行,且任何獨立裁剪可能會應用到 QPainter 用於在描繪設備中繪製。

因此,值返迴通過 QPainter::clipRegion () 在新近構造的 QPainter 不會反映由描繪係統所使用的裁剪區域。

另請參閱 QPainter , QWidget::update (), QWidget::repaint (),和 QWidget::paintEvent ().

成員函數文檔編製

QPaintEvent:: QPaintEvent (const QRegion & paintRegion )

構造描繪事件對象采用需要更新的區域。區域的指定通過 paintRegion .

QPaintEvent:: QPaintEvent (const QRect & paintRect )

構造描繪事件對象采用需要更新的矩形。區域的指定通過 paintRect .

const QRect & QPaintEvent:: rect () const

返迴需要更新的矩形。

另請參閱 region () 和 QPainter::setClipRect ().

const QRegion & QPaintEvent:: region () const

返迴需要更新的區域。

另請參閱 rect () 和 QPainter::setClipRegion ().