QML_RUNTIME_TESTING should be disabled by default.
[profile/ivi/qtdeclarative.git] / tests / auto / qtquick2 / qquickpositioners / data / attachedproperties-dynamic.qml
1 import QtQuick 2.0
2
3 Rectangle
4 {
5   width: 300
6   height: 100
7
8   Row {
9     id: pos
10     objectName: "pos"
11     anchors.fill: parent
12
13     Rectangle {
14       objectName: "rect0"
15       width: 100
16       height: 100
17       color: 'red'
18       property int index: Positioner.index
19       property bool firstItem: Positioner.isFirstItem
20       property bool lastItem: Positioner.isLastItem
21     }
22
23     Rectangle {
24       objectName: "rect1"
25       width: 100
26       height: 100
27       color: 'green'
28       property int index: Positioner.index
29       property bool firstItem: Positioner.isFirstItem
30       property bool lastItem: Positioner.isLastItem
31     }
32
33     property QtObject subRect;
34
35     function createSubRect() {
36       var component = Qt.createComponent("rectangleComponent.qml");
37       subRect = component.createObject(pos, {});
38     }
39
40     function destroySubRect() {
41       subRect.destroy();
42     }
43   }
44 }