方便子类化的 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 .
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.
[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.