本页内容

QNativeInterface::QGLXContext Struct

GLX 上下文的原生接口。更多内容...

头文件: #include <QOpenGLContext>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
自: Qt 6.0

公共函数

QGLXContext()
QGLXContext(const QNativeInterface::QGLXContext &)
QGLXContext(QNativeInterface::QGLXContext &&)
int nativeContext() const
QNativeInterface::QGLXContext &operator=(QNativeInterface::QGLXContext &&)
QNativeInterface::QGLXContext &operator=(const QNativeInterface::QGLXContext &)

静态公共成员

QOpenGLContext *fromNative(int configBasedContext, QOpenGLContext *shareContext = nullptr)
QOpenGLContext *fromNative(int visualBasedContext, void *visualInfo, QOpenGLContext *shareContext = nullptr)

详细描述

可通过QOpenGLContext::nativeInterface() 访问。

成员函数文档

[constexpr noexcept default] QGLXContext::QGLXContext()

默认——构造一个QGLXContext 实例。

[delete] QGLXContext::QGLXContext(const QNativeInterface::QGLXContext &)

复制并构造一个QGLXContext 实例。该函数已被删除。

[delete] QGLXContext::QGLXContext(QNativeInterface::QGLXContext &&)

通过移动构造一个QGLXContext 实例。该函数已被删除。

[static] QOpenGLContext *QGLXContext::fromNative(int configBasedContext, QOpenGLContext *shareContext = nullptr)

采用一个由 FBConfig 创建的 GLXContextconfigBasedContext 。

该上下文必须通过glXCreateNewContext 函数,基于帧缓冲区配置创建。

所创建的QOpenGLContext shareContext 的所有权将转移给调用方。

[static] QOpenGLContext *QGLXContext::fromNative(int visualBasedContext, void *visualInfo, QOpenGLContext *shareContext = nullptr)

采用一个由 X 可视对象创建的 GLXContext。

该上下文必须通过glXCreateContext 函数从一个视觉对象创建。必须将同一个视觉对象作为XVisualInfo 结构体的指针,传递给visualInfo 参数。

所创建的QOpenGLContext 的所有权将转移给调用方。

int QGLXContext::nativeContext() const

返回底层的 GLXContext。

[delete] QNativeInterface::QGLXContext &QGLXContext::operator=(QNativeInterface::QGLXContext &&)

将other 按移动赋值方式赋值给该QGLXContext 实例。此函数已被删除。

[delete] QNativeInterface::QGLXContext &QGLXContext::operator=(const QNativeInterface::QGLXContext &)

将other 复制并赋值给此QGLXContext 实例。该函数已被删除。

© 2026 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.