Anchors

Anchors allow you to manage item geometry by attaching certain points of some objects to points of another object. These points are called anchor lines. The following diagram shows the anchor lines that are available for each Qt Quick item:

You can establish bindings between anchor lines to manage relative positioning of items. For each anchor line, there is a property that returns the current coordinate of that anchor line. For example, the left property returns the x coordinate of the left border of the item, and the top property returns the y coordinate of its top border. Next, each object contains the anchors property group that ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.