How to actually "contain" Items
Solved
QML and Qt Quick
-
Consider this short code:
Rectangle { anchors.centerIn: parent color: "red" width: 100 height: 100 Rectangle { anchors.left: parent.horizontalCenter anchors.top: parent.verticalCenter width: 100 height: 100 color: "green" } }
It draws two squares. The top-left corner of the green square is placed in the center of the red one:
http://picpaste.com/pics/rect2985-1-037CdPPL.1464890945.png
I want the inner elements are "trimmed" by the container. So this is what I expect:
http://picpaste.com/pics/rect2985-1-Sx7qer9d.1464891040.png
I make the example using two rects, but the question is open to any QML Types.
-
@medyakovvit exactly what I need! Thanks a lot