C

Visual canvas

Coordinate system

The top-left pixel in the Qt Quick Ultralite coordinate system is the [0, 0] pixel. The coordinate system of a child item is relative to its visual parent item. For details about the coordinate system utilized by Qt Quick Ultralite, see Visual coordinates.

Visual parent

There are two separate kinds of parenting in a QML application that uses Qt Quick Ultralite. The first is the ownership parent, which determines the object lifetime semantics. The second is the visual parent, which determines where an item is drawn on the canvas and certain properties (for example, whether opacity applies to visual children).

In almost all cases, the visual parent is identical to the ownership parent. For details, see Visual parent.

Scene graph

Using a scene graph for graphics rather than the traditional imperative painting systems (QPainter and similar) means that the scene to be rendered can be retained between frames, and the complete set of primitives to render is known before the rendering starts. This opens up several optimization possibilities, such as batch rendering to minimize state changes and discard obscured primitives.

For example, say a user interface contains a list of ten items, each with a background color, an icon, and some text. Using traditional drawing would result in 30 draw calls and a similar amount of state changes. A scene graph, on the other hand, can reorganize the primitives to render so that all backgrounds are drawn in one call, then all the icons, and then all the texts, which reduces the total amount of draw calls.

Available under certain Qt licenses.
Find out more.