En esta página

QNativeInterface::QWGLContext Struct

Interfaz nativa para un contexto WGL en Windows. Más...

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

Funciones Públicas

virtual HGLRC nativeContext() const = 0

Miembros Públicos Estáticos

QOpenGLContext *fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext = nullptr)
HMODULE openGLModuleHandle()

Descripción Detallada

Se accede a través de QOpenGLContext::nativeInterface().

Documentación de la Función Miembro

[static] QOpenGLContext *QWGLContext::fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext = nullptr)

Adopta un manejador WGL context.

El window es necesario porque se consultará su formato de píxel. Cuando la adopción tiene éxito, QOpenGLContext::format() devolverá un QSurfaceFormat que describe este formato de píxel.

Nota: La ventana especificada por window debe tener su formato de píxel establecido en un formato compatible con el del contexto. Si no se ha realizado ninguna llamada a SetPixelFormat() en ningún contexto de dispositivo perteneciente a la ventana, la adopción del contexto fallará.

La propiedad del QOpenGLContext creado shareContext se transfiere a la persona que llama.

[pure virtual] HGLRC QWGLContext::nativeContext() const

Devuelve el manejador de contexto subyacente.

[static] HMODULE QWGLContext::openGLModuleHandle()

Devuelve el manejador de la implementación de OpenGL que se está utilizando actualmente.

Nota: Esta función requiere que la instancia QGuiApplication ya esté creada.

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