QRasterWindow Class
QRasterWindow 是一个方便的类,用于在QWindow 上使用QPainter... 更多...
头文件: | #include <QRasterWindow> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
继承: | QPaintDeviceWindow |
公共函数
QRasterWindow(QWindow *parent = nullptr) |
详细说明
QRasterWindow 是一个QWindow ,具有基于光栅的非 OpenGL 表面。在QWindow 提供的功能基础上,QRasterWindow 增加了一个虚拟paintEvent() 函数,并可在自身上打开QPainter 。底层绘画引擎将是光栅引擎,这意味着所有绘画都将在 CPU 上进行。要执行基于 OpenGL 的加速绘图,请使用QOpenGLWindow 。
从内部看,该类是QWindow 和QBackingStore 的精简封装,与直接使用这些类的光栅窗口示例非常相似。
另请参阅 QPaintDeviceWindow::paintEvent() 和QPaintDeviceWindow::update()。
成员函数文档
[explicit]
QRasterWindow::QRasterWindow(QWindow *parent = nullptr)
使用parent 构建一个新的 QRasterWindow。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.