内容表

上一话题

QPaintEngineState

下一话题

QPainter

QPaintEvent

QPaintEvent class contains event parameters for paint events. 更多

Inheritance diagram of PySide2.QtGui.QPaintEvent

概要

函数

详细描述

描绘事件会被发送给需要更新自身的 Widget,例如:当由于移动覆盖 Widget,而露给 Widget 的一部分时。

事件包含 region() that needs to be updated, and a rect() that is the bounding rectangle of that region. Both are provided because many widgets cannot make much use of region() ,和 rect() can be much faster than region() .boundingRect().

自动裁剪

描绘被裁剪到 region() during the processing of a paint event. This clipping is performed by Qt’s paint system and is independent of any clipping that may be applied to a QPainter 用于在描绘设备上绘制。

因此,返回值通过 clipRegion() on a newly-constructed QPainter 不会反映由描绘系统所使用的裁剪区域。

另请参阅

QPainter update() repaint() paintEvent()

class QPaintEvent ( paintRect )

QPaintEvent(paintRegion)

参数
  • paintRect QRect

  • paintRegion QRegion

PySide2.QtGui.QPaintEvent. rect ( )
返回类型

QRect

返回需要被更新的矩形。

PySide2.QtGui.QPaintEvent. region ( )
返回类型

QRegion

返回需要被更新的区域。