diff options
Diffstat (limited to 'examples/declarative/namespaces/components.qml')
-rw-r--r-- | examples/declarative/namespaces/components.qml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/declarative/namespaces/components.qml b/examples/declarative/namespaces/components.qml new file mode 100644 index 0000000..ea5e2d9 --- /dev/null +++ b/examples/declarative/namespaces/components.qml @@ -0,0 +1,17 @@ +<Item id="Root"> + <properties> + <Property name="period" value="1000"/> + <Property name="color" value="green"/> + </properties> + + <Component id="SpinSquare"> + <Item> + <Rect color="{Root.color}" width="{Root.width}" height="{width}" x="{-width/2}" y="{-height/2}"/> + <rotation> + <NumericAnimation from="0" to="360" repeat="true" running="true" duration="{Root.period}"/> + </rotation> + </Item> + </Component> + + <ComponentInstance component="{SpinSquare}" x="{Root.width/2}" y="{Root.height/2}"/> +</Item> |