QWaylandSurfaceGrabber Class
QWaylandSurfaceGrabber 类允许读取QWaylandSurface... 更多...
Header: | #include <QWaylandSurfaceGrabber> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
qmake: | QT += waylandcompositor |
继承: | QObject |
公共类型
enum | Error { InvalidSurface, NoBufferAttached, UnknownBufferType, RendererNotReady } |
公共函数
QWaylandSurfaceGrabber(QWaylandSurface *surface, QObject *parent = nullptr) | |
void | grab() |
QWaylandSurface * | surface() const |
详细说明
有时需要获取曲面的内容,例如为用户提供截图。QWaylandSurfaceGrabber 类提供了一个简单的方法来实现这一目的,而无需关心支持曲面的缓冲区类型,无论是共享内存、OpenGL 还是其他。
成员类型文档
enum QWaylandSurfaceGrabber::Error
错误枚举描述了抓取失败的原因。
常量 | 值 | 说明 |
---|---|---|
QWaylandSurfaceGrabber::InvalidSurface | 0 | 曲面为空或无效。 |
QWaylandSurfaceGrabber::NoBufferAttached | 1 | 客户端尚未在表面附加缓冲区。 |
QWaylandSurfaceGrabber::UnknownBufferType | 2 | 曲面上附加的缓冲区类型未知。 |
QWaylandSurfaceGrabber::RendererNotReady | 3 | 合成器渲染器尚未准备好抓取曲面内容。 |
成员函数文档
[explicit]
QWaylandSurfaceGrabber::QWaylandSurfaceGrabber(QWaylandSurface *surface, QObject *parent = nullptr)
用给定的surface 和parent
void QWaylandSurfaceGrabber::grab()
抓取设置在此对象上的曲面内容。可能无法立即完成抓取,因此应使用成功和失败信号来通知抓取完成的时间。
QWaylandSurface *QWaylandSurfaceGrabber::surface() const
返回此对象的曲面设置
© 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.