O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Parent–child relationship between items

Imagine that you need to create a graphics item that contains multiple geometric primitives, for example, a circle inside a rectangle. You can create both items and add them to the scene individually, but this solution is inconvenient. First, when you need to remove that combination from the scene, you would need to manually delete both items. However, more importantly, when you need to move or transform the combination, you will need to calculate positions and complex transformations for each graphics item.

Fortunately, graphics items do not have to be a flat list of items added directly into the scene. Items can be added into any other items, forming a parent–child relationship very similar to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required