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 ().
构造描绘事件对象采用需要更新的区域。区域的指定通过 paintRegion .
构造描绘事件对象采用需要更新的矩形。区域的指定通过 paintRect .
返回需要更新的矩形。
另请参阅 region () 和 QPainter::setClipRect ().
返回需要更新的区域。
另请参阅 rect () 和 QPainter::setClipRegion ().