How to actually "contain" Items
-
wrote on 2 Jun 2016, 18:12 last edited by
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.
-
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.
wrote on 3 Jun 2016, 02:19 last edited by -
wrote on 3 Jun 2016, 06:58 last edited by
@medyakovvit exactly what I need! Thanks a lot
1/3