diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/StackView.qml | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/tests/manual/StackView.qml b/tests/manual/StackView.qml index 3b5fdf6b..dee7cd31 100644 --- a/tests/manual/StackView.qml +++ b/tests/manual/StackView.qml @@ -49,7 +49,7 @@ Window { StackView { id: stackView anchors.fill: parent - initialItem: pageComponent + initialItem: itemComponent } property StackViewDelegate fadeTransition: StackViewDelegate { @@ -132,58 +132,58 @@ Window { } Component { - id: pageComponent + id: itemComponent Item { - id: page + id: item width: parent.width height: parent.height - Component.onDestruction: console.log("destroyed component page: " + Stack.index) + Component.onDestruction: console.log("destroyed component item: " + Stack.index) property bool pushFromOnCompleted: false - Component.onCompleted: if (pushFromOnCompleted) stackView.push(pageComponent) + Component.onCompleted: if (pushFromOnCompleted) stackView.push(itemComponent) Rectangle { anchors.fill: parent - color: page.Stack.index % 2 ? "green" : "yellow" + color: item.Stack.index % 2 ? "green" : "yellow" Column { Text { - text: "This is component page: " + page.Stack.index + text: "This is component item: " + item.Stack.index } Text { - text: "Current status: " + page.Stack.status + text: "Current status: " + item.Stack.status } Text { text:" " } Button { - text: "Push component page" - onClicked: stackView.push(pageComponent) + text: "Push component item" + onClicked: stackView.push(itemComponent) } Button { - text: "Push inline page" - onClicked: stackView.push(pageInline) + text: "Push inline item" + onClicked: stackView.push(itemInline) } Button { - text: "Push page as JS object" - onClicked: stackView.push({page:pageComponent}) + text: "Push item as JS object" + onClicked: stackView.push({item:itemComponent}) } Button { text: "Push immediate" - onClicked: stackView.push({page:pageComponent, immediate:true}) + onClicked: stackView.push({item:itemComponent, immediate:true}) } Button { text: "Push replace" - onClicked: stackView.push({page:pageComponent, replace:true}) + onClicked: stackView.push({item:itemComponent, replace:true}) } Button { - text: "Push inline page with destroyOnPop == true" - onClicked: stackView.push({page:pageInline, destroyOnPop:true}) + text: "Push inline item with destroyOnPop == true" + onClicked: stackView.push({item:itemInline, destroyOnPop:true}) } Button { - text: "Push component page with destroyOnPop == false" - onClicked: stackView.push({page:pageComponent, destroyOnPop:false}) + text: "Push component item with destroyOnPop == false" + onClicked: stackView.push({item:itemComponent, destroyOnPop:false}) } Button { - text: "Push from Page.onCompleted" - onClicked: stackView.push({page:pageComponent, properties:{pushFromOnCompleted:true}}) + text: "Push from item.onCompleted" + onClicked: stackView.push({item:itemComponent, properties:{pushFromOnCompleted:true}}) } Button { text: "Pop" @@ -194,31 +194,31 @@ Window { onClicked: stackView.pop(null) } Button { - text: "Search for page 3, and pop down to it" - onClicked: stackView.pop(stackView.find(function(page) { if (page.Stack.index === 3) return true })) + text: "Search for item 3, and pop down to it" + onClicked: stackView.pop(stackView.find(function(item) { if (item.Stack.index === 3) return true })) } Button { - text: "Search for page 3, and pop down to it (dontLoad == true)" - onClicked: stackView.pop(stackView.find(function(page) { if (page.Stack.index === 3) return true }, true)) + text: "Search for item 3, and pop down to it (dontLoad == true)" + onClicked: stackView.pop(stackView.find(function(item) { if (item.Stack.index === 3) return true }, true)) } Button { text: "Clear" onClicked: stackView.clear() } Button { - text: "Push array of 100 pages" + text: "Push array of 100 items" onClicked: { var a = new Array for (var i=0; i<100; ++i) - a.push(pageComponent) + a.push(itemComponent) stackView.push(a) } } Button { - text: "Push 10 pages one by one" + text: "Push 10 items one by one" onClicked: { for (var i=0; i<10; ++i) - stackView.push(pageComponent) + stackView.push(itemComponent) } } Button { @@ -231,46 +231,46 @@ Window { } Item { - id: pageInline + id: itemInline visible: false width: parent.width height: parent.height - Component.onDestruction: console.log("destroyed inline page: " + Stack.index) + Component.onDestruction: console.log("destroyed inline item: " + Stack.index) Rectangle { anchors.fill: parent - color: pageInline.Stack.index % 2 ? "green" : "yellow" + color: itemInline.Stack.index % 2 ? "green" : "yellow" Column { Text { - text: "This is inline page: " + pageInline.Stack.index + text: "This is inline item: " + itemInline.Stack.index } Text { - text: "Current status: " + pageInline.Stack.status + text: "Current status: " + itemInline.Stack.status } Button { - text: "Push component page" - onClicked: stackView.push(pageComponent) + text: "Push component item" + onClicked: stackView.push(itemComponent) } Button { - text: "Push inline page" - onClicked: stackView.push(pageInline) + text: "Push inline item" + onClicked: stackView.push(itemInline) } Button { - text: "Push page as JS object" - onClicked: stackView.push({page:pageComponent}) + text: "Push item as JS object" + onClicked: stackView.push({item:itemComponent}) } Button { text: "Push immediate" - onClicked: stackView.push({page:pageComponent, immediate:true}) + onClicked: stackView.push({item:itemComponent, immediate:true}) } Button { - text: "Push inline page with destroyOnPop == true" - onClicked: stackView.push({page:pageInline, destroyOnPop:true}) + text: "Push inline item with destroyOnPop == true" + onClicked: stackView.push({item:itemInline, destroyOnPop:true}) } Button { - text: "Push component page with destroyOnPop == false" - onClicked: stackView.push({page:pageComponent, destroyOnPop:false}) + text: "Push component item with destroyOnPop == false" + onClicked: stackView.push({item:itemComponent, destroyOnPop:false}) } Button { text: "Pop" @@ -281,31 +281,31 @@ Window { onClicked: stackView.pop(null) } Button { - text: "Search for page 3, and pop down to it" - onClicked: stackView.pop(stackView.find(function(page) { if (pageInline.Stack.index === 3) return true })) + text: "Search for item 3, and pop down to it" + onClicked: stackView.pop(stackView.find(function(item) { if (itemInline.Stack.index === 3) return true })) } Button { - text: "Search for page 3, and pop down to it (dontLoad == true)" - onClicked: stackView.pop(stackView.find(function(page) { if (pageInline.Stack.index === 3) return true }, true)) + text: "Search for item 3, and pop down to it (dontLoad == true)" + onClicked: stackView.pop(stackView.find(function(item) { if (itemInline.Stack.index === 3) return true }, true)) } Button { text: "Clear" onClicked: stackView.clear() } Button { - text: "Push array of 100 pages" + text: "Push array of 100 items" onClicked: { var a = new Array for (var i=0; i<100; ++i) - a.push(pageComponent) + a.push(itemComponent) stackView.push(a) } } Button { - text: "Push 10 pages one by one" + text: "Push 10 items one by one" onClicked: { for (var i=0; i<10; ++i) - stackView.push(pageComponent) + stackView.push(itemComponent) } } Button { |