QPlatformSurfaceEvent Class

QPlatformSurfaceEvent 类用于通知本地平台表面事件。更多

Header: #include <QPlatformSurfaceEvent>
CMake.QPlatformSurfaceEvent find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承: QEvent

公共类型

enum SurfaceEventType { SurfaceCreated, SurfaceAboutToBeDestroyed }

公共函数

QPlatformSurfaceEvent(QPlatformSurfaceEvent::SurfaceEventType surfaceEventType)
QPlatformSurfaceEvent::SurfaceEventType surfaceEventType() const

详细说明

当底层本地表面创建或即将销毁时,平台窗口事件会同步发送到窗口和屏幕外表面。

应用程序可响应这些事件,以了解底层平台表面何时存在。

成员类型文档

enum QPlatformSurfaceEvent::SurfaceEventType

该枚举描述平台表面事件的类型。可能的类型有

常量描述
QPlatformSurfaceEvent::SurfaceCreated0底层原生曲面已创建
QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed1底层本地表面将在此事件发生后立即销毁

SurfaceAboutToBeDestroyed 事件类型可用于在平台窗口销毁前停止渲染。

成员函数文档

[explicit] QPlatformSurfaceEvent::QPlatformSurfaceEvent(QPlatformSurfaceEvent::SurfaceEventType surfaceEventType)

为给定的surfaceEventType 构建平台表面事件。

QPlatformSurfaceEvent::SurfaceEventType QPlatformSurfaceEvent::surfaceEventType() 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.