summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/contacts/2_Reuse/1b/BlueRect.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/tutorials/contacts/2_Reuse/1b/BlueRect.qml')
-rw-r--r--examples/declarative/tutorials/contacts/2_Reuse/1b/BlueRect.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/declarative/tutorials/contacts/2_Reuse/1b/BlueRect.qml b/examples/declarative/tutorials/contacts/2_Reuse/1b/BlueRect.qml
new file mode 100644
index 0000000..92893f6
--- /dev/null
+++ b/examples/declarative/tutorials/contacts/2_Reuse/1b/BlueRect.qml
@@ -0,0 +1,33 @@
+//! [all]
+Rect {
+ width: 100
+ height: 100
+ color: "blue"
+ resources: [
+ Component {
+ id: redRectangle
+ Rect {
+ width: 30
+ height: 30
+ color: "red"
+ radius: 5
+ }
+ }
+ ]
+ ComponentInstance {
+ component: redRectangle
+ anchors.right: parent.right
+ anchors.top: parent.top
+ }
+ ComponentInstance {
+ component: redRectangle
+ anchors.left: parent.left
+ anchors.top: parent.top
+ }
+ ComponentInstance {
+ component: redRectangle
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ }
+}
+//! [all]