[Feature Request] Exposing QNativeInterface::QSGOpenGLTexture functionality in PyQt6
Phil Thompson
phil at riverbankcomputing.com
Thu Jul 16 13:14:18 BST 2026
On 09/07/2026 14:11, pike wrote:
> Hi Phil and list,
>
> I am working on a PyQt6 project that integrates an external OpenGL
> rendering engine (projectM) with a Qt Quick scene graph via custom
> QQuickItems.
>
> To display our raw GL texture IDs inside the scene graph, the standard
> Qt 6 approach is to use the public API found in
> <QtQuick/qsgtexture_platform.h>:
> C++
>
> QNativeInterface::QSGOpenGLTexture::fromNative(
> GLuint textureId,
> QQuickWindow *window,
> const QSize &size,
> QQuickWindow::CreateTextureOptions options = {}
> );
>
> Currently, this functionality is inaccessible in PyQt6. I understand
> that QNativeInterface relies heavily on macros
> (QT_DECLARE_NATIVE_INTERFACE) that don't map cleanly to standard SIP
> class generation, and that The Qt Company explicitly tags the native
> interfaces as lacking strict source/binary compatibility guarantees
> across point releases.
This function *is* implemented (whether it works or not is a different
question). The confusion is that the QNativeInterface namespace is in
the QtCore module (despite what the fromNative() docs say).
Phil
More information about the PyQt
mailing list