QNativeInterface::QEGLContext Struct
EGL 上下文的本地接口。更多
头文件: | #include <QOpenGLContext> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
自 | Qt 6.0 |
- 所有成员的列表,包括继承成员
- QEGLContext 是本地接口的一部分。
公共函数
(since 6.3) virtual EGLConfig | config() const = 0 |
(since 6.3) virtual EGLDisplay | display() const = 0 |
(since 6.5) virtual void | invalidateContext() = 0 |
virtual EGLContext | nativeContext() const = 0 |
静态公共成员
QOpenGLContext * | fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext = nullptr) |
详细说明
通过QOpenGLContext::nativeInterface() 访问。
成员函数文档
[pure virtual, since 6.3]
EGLConfig QEGLContext::config() const
返回与底层 EGLContext 关联的 EGLConfig。
此函数在 Qt 6.3 中引入。
[pure virtual, since 6.3]
EGLDisplay QEGLContext::display() const
返回与底层 EGLContext 关联的 EGLDisplay。
此函数在 Qt 6.3 中引入。
[static]
QOpenGLContext *QEGLContext::fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext = nullptr)
采用 EGLContextcontext 。
display 参数必须与传给eglCreateContext
的EGLDisplay
相同。
创建的QOpenGLContext shareContext 的所有权将转移给调用者。
[pure virtual, since 6.5]
void QEGLContext::invalidateContext()
将上下文标记为无效
如果Qt Quick 场景图使用了此上下文,这将触发场景图销毁此上下文并创建新的上下文。
类似于 QPlatformWindow::invalidateSurface(),该函数只能在某些平台(如 eglfs)上使用。
此函数在 Qt 6.5 中引入。
另请参阅 QOpenGLContext::isValid() 和 QPlatformWindow::invalidateSurface()。
[pure virtual]
EGLContext QEGLContext::nativeContext() const
返回底层 EGLContext。
© 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.