Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / qdeclarativepositioners / dynamic.qml
1 import QtQuick 1.0
2
3 Item {
4     property string skip: "Expected to fail until QTBUG-14839 is resolved"
5     width: 120; height: 60;
6     property int step: 0
7     function tick()
8     {
9         step++;
10         if(step == 1){
11             //row1.destroy(); //Not dynamically created, so is this valid?
12         }else if(step == 2){
13             r2a.destroy();
14         }else if(step == 3){
15             r2b.destroy();
16         }else if(step == 4){
17             r2c.destroy();
18         }else if(step == 5){
19             r3a.parent = row2;
20         }else if(step == 6){
21             r3b.parent = row2;
22         }else if(step == 7){
23             r3c.parent = row2;
24         }else if(step == 8){
25             //row3.destroy();//empty now, so should have no effect//May be invalid, but was deleting the reparent items at one point
26         }else{
27             repeater.model++;
28         }
29     }
30
31     //Tests base positioner functionality, so don't need them all.
32     Column{
33         move: Transition{NumberAnimation{properties:"y"}}
34         Row{
35             id: row1
36             height: childrenRect.height
37             Rectangle{id: r1a; width:20; height:20; color: "red"}
38             Rectangle{id: r1b; width:20; height:20; color: "green"}
39             Rectangle{id: r1c; width:20; height:20; color: "blue"}
40         }
41         Row{
42             id: row2
43             height: childrenRect.height
44             move: Transition{NumberAnimation{properties:"x"}}
45             Repeater{ 
46                 id: repeater 
47                 model: 0; 
48                 delegate: Component{ Rectangle { color: "yellow"; width:20; height:20;}}
49             }
50             Rectangle{id: r2a; width:20; height:20; color: "red"}
51             Rectangle{id: r2b; width:20; height:20; color: "green"}
52             Rectangle{id: r2c; width:20; height:20; color: "blue"}
53         }
54         Row{
55             move: Transition{NumberAnimation{properties:"x"}}
56             id: row3
57             height: childrenRect.height
58             Rectangle{id: r3a; width:20; height:20; color: "red"}
59             Rectangle{id: r3b; width:20; height:20; color: "green"}
60             Rectangle{id: r3c; width:20; height:20; color: "blue"}
61         }
62     }
63     Timer{
64         interval: 250;
65         running: true;
66         repeat: true;
67         onTriggered: tick();
68     }
69 }
70