Understanding the Qt Quick scene graph
Qt Quick 2 employs a dedicated scene graph that is traversed and rendered using a graphics API, including OpenGL, OpenGL ES, Metal, Vulkan, or Direct 3D. Using a scene graph for graphics instead of traditional imperative painting systems (QPainter
and similar), allows the scene to be rendered to be retained between frames and the entire set of primitives to render to be known before rendering begins. This allows for a variety of optimizations, including batch rendering to reduce state changes and discarding obscured primitives.
Let's assume a GUI comprises a list of 10 elements and each one has a different background color, text, and icon. This would give us 30 draw calls and an identical number of state changes using traditional drawing techniques. Contrarily, a scene graph reorganizes the primitives to render so that one call can draw all backgrounds, icons, and text, dropping the total number of draw calls to three. This type of batching...