| 1 |
import QtQuick 2.0 |
| 2 |
|
| 3 |
// no bindings or anchors. |
| 4 |
Rectangle { |
| 5 |
id: p |
| 6 |
color: "red" |
| 7 |
width: 400 |
| 8 |
height: 800 |
| 9 |
|
| 10 |
Rectangle { |
| 11 |
id: c |
| 12 |
color: "blue" |
| 13 |
width: 400 |
| 14 |
height: 200 |
| 15 |
|
| 16 |
Rectangle { |
| 17 |
id: n1 |
| 18 |
color: "green" |
| 19 |
width: 200 |
| 20 |
height: 50 |
| 21 |
} |
| 22 |
|
| 23 |
Rectangle { |
| 24 |
id: n2 |
| 25 |
color: "cyan" |
| 26 |
width: 200 |
| 27 |
height: 50 |
| 28 |
} |
| 29 |
|
| 30 |
Rectangle { |
| 31 |
id: n3 |
| 32 |
color: "aquamarine" |
| 33 |
width: 200 |
| 34 |
height: 50 |
| 35 |
} |
| 36 |
|
| 37 |
Rectangle { |
| 38 |
id: n4 |
| 39 |
color: "lightgreen" |
| 40 |
width: 200 |
| 41 |
height: 50 |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
// for visually determining correctness. |
| 46 |
//Timer { |
| 47 |
// property int count: 0 |
| 48 |
// interval: 1000 |
| 49 |
// running: true |
| 50 |
// repeat: true |
| 51 |
// onTriggered: { |
| 52 |
// if (count == 0) { |
| 53 |
// count = 1; |
| 54 |
// p.height = 800; |
| 55 |
// } else { |
| 56 |
// count = 0; |
| 57 |
// p.height = 400; |
| 58 |
// } |
| 59 |
// } |
| 60 |
//} |
| 61 |
|
| 62 |
Component.onCompleted: { |
| 63 |
var iterations = 10000; |
| 64 |
//var t0 = new Date(); |
| 65 |
while (iterations > 0) { |
| 66 |
iterations--; |
| 67 |
p.height = 800; |
| 68 |
p.height = 400; |
| 69 |
} |
| 70 |
//var t1 = new Date(); |
| 71 |
//console.log("No Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); |
| 72 |
} |
| 73 |
} |