方便子类化的 QWindow 也是 QPaintDevice . 更多...
头: | #include <QPaintDeviceWindow> |
qmake: | QT += gui |
Since: | Qt 5.4 |
继承: | QWindow and QPaintDevice |
继承者: |
该类在 Qt 5.4 引入。
void | update (const QRect & rect ) |
void | update (const QRegion & region ) |
void | update () |
virtual void | paintEvent (QPaintEvent * event ) |
QPaintDeviceWindow 像常规 QWindow , with the added functionality of being a paint device too. Whenever the content needs to be updated, the virtual paintEvent () function is called. Subclasses, that reimplement this function, can then simply open a QPainter on the window.
注意: 此类不能直接被用于应用程序。它宁愿充当子类的基,像 QOpenGLWindow .
另请参阅 QOpenGLWindow .
[slot]
void
QPaintDeviceWindow::
update
()
Marks the entire window as dirty and schedules a repaint.
注意: Subsequent calls to this function before the next paint event will get ignored.
注意: For non-exposed windows the update is deferred until the window becomes exposed again.
[virtual protected]
void
QPaintDeviceWindow::
paintEvent
(
QPaintEvent
*
event
)
处理描绘事件传入的 event 参数。
The default implementation does nothing. Reimplement this function to perform painting. If necessary, the dirty area is retrievable from the event .
Marks the rect of the window as dirty and schedules a repaint.
注意: Subsequent calls to this function before the next paint event will get ignored, but rect is added to the region to update.
注意: For non-exposed windows the update is deferred until the window becomes exposed again.
Marks the region of the window as dirty and schedules a repaint.
注意: Subsequent calls to this function before the next paint event will get ignored, but region is added to the region to update.
注意: For non-exposed windows the update is deferred until the window becomes exposed again.