Positioning with Anchors in QML
QML provides anchors to position different items relative to each others.
For each item, there are 7 imaginary lines called anchor lines. An item can be placed in these anchor lines relative to another item(parent or any sibling).

The 7th anchor is baseline, for text items, it's an imaginary line on which a text rests. For letters like g, the descender goes below the baseline. Some non-Latin characters can have some part below baseline like(ନ୍ଧୁ in Odia). It’s only useful for text based elements.
You can use any of those 7 anchor line properties to place your item.

Here left edge of rect2 is bound with the right edge of rect1. It looks like this

By using different combination of anchors, we can achieve the desired placement of different rectangles. We can control the size too.
Example 1
We have a green rectangle at (10, 10). We want to align a blue rectangle just below it.

We will align the top anchor line of the blue rectangle with the bottom anchor line of the green rectangle and left anchor line of the blue rectangle with the left anchor line of the green rectangle respectively.





















