diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/objectLookupOnListElement.qml')
-rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/objectLookupOnListElement.qml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/objectLookupOnListElement.qml b/tests/auto/qml/qmlcppcodegen/data/objectLookupOnListElement.qml new file mode 100644 index 0000000000..4804921b02 --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/objectLookupOnListElement.qml @@ -0,0 +1,34 @@ +pragma Strict +import QtQuick + +Item { + id: stack + + property int current: 0 + + onCurrentChanged: setZOrders() + Component.onCompleted: setZOrders() + + function setZOrders() { + for (var i = 0; i < Math.max(stack.children.length, 3); ++i) { + stack.children[i].z = (i == current ? 1 : 0) + stack.children[i].enabled = (i == current) + } + } + + function zOrders() : list<int> { + return [ + stack.children[0].z, + stack.children[1].z, + stack.children[2].z + ] + } + + function clearChildren() { + children.length = 0; + } + + Item {} + Item {} + Item {} +} |