- Qt 6.9
- Qt Quick
- QML Types
- GraphicsInfo
- Qt 6.9.2 Reference Documentation

# GraphicsInfo QML Type

Provides information about the scenegraph backend and the graphics API used by Qt Quick. More...

Import Statement: | `import QtQuick`
Since: | QtQuick 2.8

- List of all members, including inherited members

## Properties

- api : enumeration
- majorVersion : int
- minorVersion : int
- profile : enumeration
- renderableType : enumeration
- shaderCompilationType : enumeration `(since QtQuick 2.8)`
- shaderSourceType : enumeration `(since QtQuick 2.8)`
- shaderType : enumeration `(since QtQuick 2.8)`

## Detailed Description

The GraphicsInfo attached type provides information about the scenegraph backend and the graphics API used to render the contents of the associated window.

If the item to which the properties are attached is not currently associated with any window, the properties are set to default values. When the associated window changes, the properties will update.

## Property Documentation

api : enumeration

This property describes the graphics API that is currently in use.

The possible values are:

Constant | Description
--- | ---
`GraphicsInfo.Unknown` | the default value when no active scenegraph is associated with the item
`GraphicsInfo.Software` | Qt Quick's software renderer based on QPainter with the raster paint engine
`GraphicsInfo.OpenVG` | OpenVG
`GraphicsInfo.OpenGL` | OpenGL or OpenGL ES on top of QRhi, a graphics abstraction layer
`GraphicsInfo.Direct3D11` | Direct3D 11 on top of QRhi, a graphics abstraction layer
`GraphicsInfo.Direct3D12` | Direct3D 12 on top of QRhi, a graphics abstraction layer
`GraphicsInfo.Vulkan` | Vulkan on top of QRhi, a graphics abstraction layer
`GraphicsInfo.Metal` | Metal on top of QRhi, a graphics abstraction layer
`GraphicsInfo.Null` | Null (no output) on top of QRhi, a graphics abstraction layer

majorVersion : int

This property holds the major version of the graphics API in use.

With OpenGL the default version is `2.0`.

Note: This is applicable only to OpenGL.

See also minorVersion and profile.

minorVersion : int

This property holds the minor version of the graphics API in use.

With OpenGL the default version is `2.0`.

Note: This is applicable only to OpenGL.

See also majorVersion and profile.

profile : enumeration

This property holds the configured OpenGL context profile.

The possible values are:

Constant | Description
--- | ---
`GraphicsInfo.OpenGLNoProfile` | (default) OpenGL version is lower than 3.2 or OpenGL is not in use.
`GraphicsInfo.OpenGLCoreProfile` | Functionality deprecated in OpenGL version 3.0 is not available.
`GraphicsInfo.OpenGLCompatibilityProfile` | Functionality from earlier OpenGL versions is available.

Reusable QML components will typically use this property in bindings in order to choose between core and non core profile compatible shader sources.

Note: This is applicable only to OpenGL.

See also majorVersion, minorVersion, and QSurfaceFormat.

renderableType : enumeration

This property holds the renderable type. The value has no meaning for APIs other than OpenGL.

The possible values are:

Constant | Description
--- | ---
`GraphicsInfo.SurfaceFormatUnspecified` | (default) Unspecified rendering method
`GraphicsInfo.SurfaceFormatOpenGL` | Desktop OpenGL or other graphics API
`GraphicsInfo.SurfaceFormatOpenGLES` | OpenGL ES

Note: This is applicable only to OpenGL.

See also QSurfaceFormat.

shaderCompilationType : enumeration `[since QtQuick 2.8]`

This property contains a bitmask of the shader compilation approaches supported by the Qt Quick backend the application is using.

Constant | Value
--- | ---
`GraphicsInfo.RuntimeCompilation`
`GraphicsInfo.OfflineCompilation`

With OpenGL the value is GraphicsInfo.RuntimeCompilation, which corresponds to the traditional way of using ShaderEffect. Non-OpenGL backends are expected to focus more on GraphicsInfo.OfflineCompilation, however.

Note: The value is only up-to-date once the item is associated with a window. Bindings relying on the value have to keep this in mind since the value may change from `0` to the actual bitmask after component initialization is complete. This is particularly relevant for ShaderEffect items inside ShaderEffectSource items set as property values.

This property was introduced in QtQuick 2.8.

See also shaderType and shaderSourceType.

shaderSourceType : enumeration `[since QtQuick 2.8]`

This property contains a bitmask of the supported ways of providing shader sources.

Constant | Value
--- | ---
`GraphicsInfo.ShaderSourceString`
`GraphicsInfo.ShaderSourceFile`
`GraphicsInfo.ShaderByteCode`

With OpenGL the value is GraphicsInfo.ShaderSourceString, which corresponds to the traditional way of inlining GLSL source code into QML. Other, non-OpenGL Qt Quick backends may however decide not to support inlined shader sources, or even shader sources at all. In this case shaders are expected to be pre-compiled into formats like SPIR-V or D3D shader bytecode.

Note: The value is only up-to-date once the item is associated with a window. Bindings relying on the value have to keep this in mind since the value may change from `0` to the actual bitmask after component initialization is complete. This is particularly relevant for ShaderEffect items inside ShaderEffectSource items set as property values.

This property was introduced in QtQuick 2.8.

See also shaderType and shaderCompilationType.

shaderType : enumeration `[since QtQuick 2.8]`

This property contains the shading language supported by the Qt Quick backend the application is using.

Constant | Description
--- | ---
`GraphicsInfo.UnknownShadingLanguage` | Not yet known due to no window and scenegraph associated
`GraphicsInfo.GLSL` | GLSL or GLSL ES
`GraphicsInfo.HLSL` | HLSL
`GraphicsInfo.RhiShader` | QShader

Note: The value is only up-to-date once the item is associated with a window. Bindings relying on the value have to keep this in mind since the value may change from GraphicsInfo.UnknownShadingLanguage to the actual value after component initialization is complete. This is particularly relevant for ShaderEffect items inside ShaderEffectSource items set as property values.

This property was introduced in QtQuick 2.8.

See also shaderCompilationType and shaderSourceType.