QPaintDeviceWindow 类

方便子类化的 QWindow 也是 QPaintDevice . 更多...

头: #include <QPaintDeviceWindow>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承: QWindow and QPaintDevice
继承者: QOpenGLWindow and QRasterWindow

公共函数

void update (const QRect & rect )
void update (const QRegion & region )

公共槽

void update ()

重实现保护函数

virtual void paintEvent (QPaintEvent * event ) override

详细描述

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 .

成员函数文档编制

[override virtual protected] void QPaintDeviceWindow:: paintEvent ( QPaintEvent * event )

重实现: QWindow::paintEvent (QPaintEvent *ev).

处理描绘事件传入的 event 参数。

The default implementation does nothing. Reimplement this function to perform painting. If necessary, the dirty area is retrievable from the event .

void QPaintDeviceWindow:: update (const QRect & rect )

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.

void QPaintDeviceWindow:: update (const QRegion & region )

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.

[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.