QSGEngine Class

The QSGEngine class allows low level rendering of a scene graph. More...

Header: #include <QSGEngine>
qmake: QT += quick
Since: Qt 5.4
Inherits: QObject

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This class was introduced in Qt 5.4.

Public Types

enum CreateTextureOption { TextureHasAlphaChannel, TextureOwnsGLTexture, TextureCanUseAtlas, TextureIsOpaque }

Detailed Description

A QSGEngine can be used to render a tree of QSGNode directly on a QWindow or QOpenGLFramebufferObject without any integration with QML, QQuickWindow or QQuickItem and the convenience that they provide.

This means that you must handle event propagation, animation timing, and node lifetime yourself.

Note: This class is for very low level access to an independent scene graph. Most of the time you will instead want to subclass QQuickItem and insert your QSGNode in a normal QtQuick scene by overriding QQuickItem::updatePaintNode().

Warning: This class is only suitable when working directly with OpenGL. It is not compatible with the RHI-based rendering path.

See also QSGAbstractRenderer.

Member Type Documentation

enum QSGEngine::CreateTextureOption

The CreateTextureOption enums are used to customize how a texture is wrapped.

ConstantValueDescription
QSGEngine::TextureHasAlphaChannel0x0001The texture has an alpha channel and should be drawn using blending.
QSGEngine::TextureOwnsGLTexture0x0004The texture object owns the texture id and will delete the GL texture when the texture object is deleted.
QSGEngine::TextureCanUseAtlas0x0008The image can be uploaded into a texture atlas.
QSGEngine::TextureIsOpaque0x0010The texture object is opaque.