[Development] Qt 6 graphics next steps
laszlo.agocs at qt.io
Mon May 11 08:41:12 CEST 2020
As outlined by Jani a few weeks ago , Qt 6.0 is expected to have a
Structure and Platform Freeze at the end of June. One essential piece
there is the graphics story. After evolving for some years (Qt
Contributor Summit 2017, 2018, 2019 notes can be found in , 
), the plan described last spring  has been progressing
nicely. We are now moving on to flip a few switches in the dev branch
in order to begin switching over to the new rendering architecture in
This affects Qt Quick and dependent modules at the moment. Plain
widget applications, and this includes QOpenGLWindow and
QOpenGLWidget, are not currently affected by this work. (apart from
minor restructuring, such as moving most QOpenGL* convenience classes
into the Qt OpenGL module, out from Qt Gui).
As the documentation  describes, Qt 5.14 and 5.15 have shipped the
new, graphics API abstracted Qt Quick scenegraph rendering engine as
an experimental, opt-in feature, meaning one had to set an environment
variable or call some C++ APIs to enable it. The same applies to the
dev branch as of today. This is what's going to change now.
== Phase One ==
As the first step, the defaults will be switched around. Instead of
opting in by setting the environment variable QSG_RHI=1, one can now
opt out, if desired, by setting QSG_NO_RHI=1.
This switch is expected to happen as soon as possible. (i.e. today or
the next few days at latest) This is a temporary, short-term
measure. The direct OpenGL rendering path is kept available to make
testing and transitioning easier. However, this will disappear in the
In fact, some leaf modules, like Qt Quick 3D, have during the last few
days already merged patches that purge their direct OpenGL rendering
backends, leaving only the new, QRhi-based rendering code path in
place. This shows that we are in good shape, and can likely keep the
length of this phase quite short, moving on to phase two as quickly as
This phase presents no source breaks, meaning all modules and
applications continue to compile as-is, but advanced usages of Qt
Quick, that are not compatible with the RHI-based graphics stack, may
trigger run time breaks.
== Phase Two ==
Purging the direct OpenGL bits in Qt Quick is work in progress,
although none of the patches are merged yet. In this second phase we
are going to proceed with that work, which means the possibility
of opting out (QSG_NO_RHI) will disappear.
This is the point where one may encounter source breaks due to
deprecated and/or OpenGL-specific APIs being removed or replaced by
new alternatives. This will typically affect advanced use cases only,
such as application code that implements custom scenegraph materials,
or deals with integrating external rendering engines with Qt Quick.
For those interested in more details, there is a set of blog posts 
  from last year introducing the new approach to handling
graphics APIs and shaders. The recording of a Qt World Summit 2019
talk is also available at . The slides from the March 2020 webinar
 give the most up-to-date overview as of now, but there is also
going to be a session at this week's Qt Virtual Tech Con 2020  (look for
"Accelerated 2D / 3D Graphics in Qt 6")
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development