From 0afc935badafe8f3a0baa17a7109d65f8e076fae Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen <richard.gustavsen@digia.com> Date: Mon, 25 Mar 2013 14:45:41 +0100 Subject: [PATCH] PageStack: rename PageStack to StackView Change-Id: Idd859547ca7c7a87cfafc882bf7593246efc58e7 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> --- examples/stackview/main.qml | 2 +- examples/touch/main.qml | 2 +- src/controls/{PageStack.qml => StackView.qml} | 88 +++++++++---------- src/controls/StackViewDelegate.qml | 4 +- src/controls/controls.pro | 2 +- src/controls/qmldir | 2 +- src/controls/qtstack.cpp | 16 ++-- src/controls/qtstack_p.h | 4 +- src/private/{PageStack.js => StackView.js} | 12 +-- src/private/private.pro | 2 +- tests/auto/controls/data/tst_pagestack.qml | 4 +- tests/auto/controls/data/tst_stack.qml | 2 +- tests/manual/{PageStack.qml => StackView.qml} | 66 +++++++------- 13 files changed, 103 insertions(+), 103 deletions(-) rename src/controls/{PageStack.qml => StackView.qml} (94%) rename src/private/{PageStack.js => StackView.js} (92%) rename tests/manual/{PageStack.qml => StackView.qml} (83%) diff --git a/examples/stackview/main.qml b/examples/stackview/main.qml index b1fb318a3..7c67a3690 100644 --- a/examples/stackview/main.qml +++ b/examples/stackview/main.qml @@ -47,7 +47,7 @@ ApplicationWindow { property alias stackView: stackView property alias componentPage: componentPage - PageStack { + StackView { id: stackView anchors.fill: parent initialPage: componentPage diff --git a/examples/touch/main.qml b/examples/touch/main.qml index 2546b7da1..c0db38f61 100644 --- a/examples/touch/main.qml +++ b/examples/touch/main.qml @@ -129,7 +129,7 @@ ApplicationWindow { } } - PageStack { + StackView { id: pageStack anchors.fill: parent diff --git a/src/controls/PageStack.qml b/src/controls/StackView.qml similarity index 94% rename from src/controls/PageStack.qml rename to src/controls/StackView.qml index 6b7ad9989..fbc1f5ec4 100644 --- a/src/controls/PageStack.qml +++ b/src/controls/StackView.qml @@ -41,17 +41,17 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 -import "Private/PageStack.js" as JSArray +import "Private/StackView.js" as JSArray /*! - \qmltype PageStack + \qmltype StackView \inherits Item \ingroup views \inqmlmodule QtQuick.Controls 1.0 \brief Provides a stack-based navigation model. - PageStack implements a stack-based navigation model for an application. + StackView implements a stack-based navigation model for an application. A stack-based navigation model means that "pages" (discrete views of information) are pushed onto a stack as the user navigates deeper into the application page hierarchy. Similarily, the user can return back to @@ -59,23 +59,23 @@ import "Private/PageStack.js" as JSArray top of the stack and re-activating them (make them visible on screen). The \l Stack attached property provides information about items pushed onto a stack. - \section1 Using PageStack in an Application - Using the PageStack in the application is typically a simple matter of adding - the PageStack as a child to e.g the applications top-level + \section1 Using StackView in an Application + Using the StackView in the application is typically a simple matter of adding + the StackView as a child to e.g the applications top-level \l{http://doc.qt.nokia.com/latest/qml-item.html} {Item}. The stack is usually anchored to the edges of the window, except at the top or bottom where it might be anchored to a status bar, or some other similar UI component. The stack can then be used by invoking its navigation methods. The first page - to show in the PageStack is commonly loaded assigning it to \l initialPage. + to show in the StackView is commonly loaded assigning it to \l initialPage. \section1 Basic Navigation - There are three primary navigation operations in PageStack: push(), pop() and + There are three primary navigation operations in StackView: push(), pop() and replace (you replace by specifying argument \c replace to push()). These correspond to classic stack operations where "push" adds a page to the top of a stack, "pop" removes the top page from the stack, and "replace" is like a pop followed by a push in that it replaces the topmost page on the stack with a new page (but the applied transtition might be different). The topmost page - in the stack corresponds to the one that is \l{PageStack::currentPage} {current}, + in the stack corresponds to the one that is \l{StackView::currentPage} {current}, i.e. the one that is visible on screen. That means that "push" is the logical equivalent of navigating forward or deeper into the application, "pop" is the equivalent of navigation back and @@ -119,7 +119,7 @@ import "Private/PageStack.js" as JSArray you e.g. push a set of pages to the top of the stack, or that you completely reset the stack to a given state. - The API for deep linking in PageStack is the same as for basic navigation. If + The API for deep linking in StackView is the same as for basic navigation. If you push an array instead of a single page then all the pages in that array will be pushed onto the stack. The transition animation, however, will be conducted as if only the last page in the array was pushed onto the stack. The normal semantics @@ -140,10 +140,10 @@ import "Private/PageStack.js" as JSArray \section1 Pushing pages - A page you push onto the PageStack can be either a \l Page, a \l{http://doc.qt.nokia.com/latest/qml-url.html}{URL}, a + A page you push onto the StackView can be either a \l Page, a \l{http://doc.qt.nokia.com/latest/qml-url.html}{URL}, a string with a URL, an \l{http://doc.qt.nokia.com/latest/qml-item.html}{Item}, or a \l{http://doc.qt.nokia.com/latest/qml-component.html}{Component}. To push it, you assign it - to a property "page" inside a property list, and send it as argument to \l{PageStack::push}{push}: + to a property "page" inside a property list, and send it as argument to \l{StackView::push}{push}: \code pageStack.push({page: yourPage}) @@ -161,9 +161,9 @@ import "Private/PageStack.js" as JSArray \li \c replace: Set this property to replace the current page on the stack. When pushing an array, you only need to set this property on the first element to replace as many elements on the stack as inside the array. - \li \c destroyOnPop: Set this property to be explicit to whether or not PageStack should + \li \c destroyOnPop: Set this property to be explicit to whether or not StackView should destroy the page when its popped off the stack. By default (if \a destroyOnPop is - not specified), PageStack will destroy pages pushed as components or URLs. Pages + not specified), StackView will destroy pages pushed as components or URLs. Pages not destroyed will be reparented back to the original parents they had before being pushed onto the stack, and hidden. If you need to set this property, do it with care, so that pages are not leaked. @@ -177,7 +177,7 @@ import "Private/PageStack.js" as JSArray \endcode You can push several pages in one go by using an array of property lists. This is - optimizing compared to pushing pages one by one, since PageStack then can load only the + optimizing compared to pushing pages one by one, since StackView then can load only the last page in the list. The rest will be loaded as they are about to become the current page (which happends when the stack is popped). The following example shows how to push an array of pages: @@ -187,11 +187,11 @@ import "Private/PageStack.js" as JSArray \endcode If inline pages/items are pushed, the page gets re-parented into an internal - container in the PageStack. When the page is later popped off, it gets + container in the StackView. When the page is later popped off, it gets re-parented back to its original owner. If, however, a page is pushed as a component or a URL, the actual page will be created as a page from that component. This happens automatically when the page is about to become the current page in the stack. Ownership - over the item will then normally be taken by the PageStack. It will as such automatically + over the item will then normally be taken by the StackView. It will as such automatically destroy the page when it is later popped off. The component that declared the page, by contrast, remains in the ownership of the application and is not destroyed by the page stack. You can override this behavior if needed by explicitly setting "destroyOnPop" in the list @@ -280,14 +280,14 @@ import "Private/PageStack.js" as JSArray from: pushTransition, popTransition, and replaceTransition. Each implements how enterPage should animate in, and exitPage out. The transitions are collected inside a StackViewDelegate object assigned to - \l {PageStack::delegate}{delegate}. By default, popTransition and + \l {StackView::delegate}{delegate}. By default, popTransition and replaceTransition will be the same as pushTransition, unless you set them to something else. A simple fade transition could be implemented as: \qml - PageStack { + StackView { delegate: StackViewDelegate { function transitionFinished(properties) { @@ -325,7 +325,7 @@ import "Private/PageStack.js" as JSArray they are rotated up in an upright position: \qml - PageStack { + StackView { delegate: StackViewDelegate { function transitionFinished(properties) { @@ -364,7 +364,7 @@ import "Private/PageStack.js" as JSArray \section2 Advanced usage - When the PageStack needs a new transition, it first calls + When the StackView needs a new transition, it first calls \l {StackViewDelegate::getTransition(properties)}{StackViewDelegate.getTransition(properties)}. The base implementation of this function just looks for a property named \c properties.name inside itself (root), which is how it finds \c {property Component pushTransition} in the examples above. @@ -378,8 +378,8 @@ import "Private/PageStack.js" as JSArray You can override this function for your delegate if you need extra logic to decide which transition to return. You could for example introspect the pages, and return different animations - depending on the their internal state. PageStack will expect you to return a Component that - contains a StackViewTransition, or a StackViewTransition directly. The former is easier, as PageStack will + depending on the their internal state. StackView will expect you to return a Component that + contains a StackViewTransition, or a StackViewTransition directly. The former is easier, as StackView will then create the transition and later destroy it when it's done, while avoiding any sideeffects caused by the transition being alive long after it ran. Returning a StackViewTransition directly can be useful if you need to write some sort of transition caching for performance reasons. @@ -447,21 +447,21 @@ import "Private/PageStack.js" as JSArray Item { id: root - /*! \qmlproperty int PageStack::depth + /*! \qmlproperty int StackView::depth \readonly The number of pages currently pushed onto the stack. */ readonly property alias depth: root.__depth - /*! \qmlproperty Item PageStack::currentPage + /*! \qmlproperty Item StackView::currentPage \readonly The currently top-most page in the stack. */ readonly property alias currentPage: root.__currentPage - /*! The first \l Page that should be shown when the PageStack is created. - \a initialPage can take same value as the first argument to \l{PageStack::push()} - {PageStack.push()}. Note that this is just a convenience for writing + /*! The first \l Page that should be shown when the StackView is created. + \a initialPage can take same value as the first argument to \l{StackView::push()} + {StackView.push()}. Note that this is just a convenience for writing \c{Component.onCompleted: pageStack.push(myInitialPage)} Examples: @@ -501,9 +501,9 @@ Item { \li \c replace: Set this property to replace the current page on the stack. When pushing an array, you only need to set this property on the first element to replace as many elements on the stack as inside the array. - \li \c destroyOnPop: Set this property to be explicit to whether or not PageStack should + \li \c destroyOnPop: Set this property to be explicit to whether or not StackView should destroy the page when its popped off the stack. By default (if \a destroyOnPop is - not specified), PageStack will destroy pages pushed as components or URLs. Pages + not specified), StackView will destroy pages pushed as components or URLs. Pages not destroyed will be reparented back to the original parents they had before being pushed onto the stack, and hidden. If you need to set this property, do it with care, so that pages are not leaked. @@ -542,7 +542,7 @@ Item { var replace = arguments[3] var arrayPushed = (page instanceof Array) var firstPage = arrayPushed ? page[0] : page - immediate = (immediate || JSArray.pageStack.length === 0) + immediate = (immediate || JSArray.stackView.length === 0) if (firstPage && firstPage.page && firstPage.hasOwnProperty("x") === false) { // Property list API used: @@ -676,7 +676,7 @@ Item { not loaded into memory */ function find(func, onlySearchLoadedPages) { for (var i=__depth-1; i>=0; --i) { - var element = JSArray.pageStack[i]; + var element = JSArray.stackView[i]; if (onlySearchLoadedPages !== true) __loadElement(element) else if (!element.page) @@ -693,9 +693,9 @@ Item { will be returned if not yet loaded) */ function get(index, dontLoad) { - if (index < 0 || index >= JSArray.pageStack.length) + if (index < 0 || index >= JSArray.stackView.length) return null - var element = JSArray.pageStack[index] + var element = JSArray.stackView[index] if (dontLoad !== true) { __loadElement(element) return element.page @@ -757,7 +757,7 @@ Item { function __recursionGuard(use) { if (use && __guard) { - console.warn("Warning: PageStack: You cannot push/pop recursively!") + console.warn("Warning: StackView: You cannot push/pop recursively!") console.trace() return true } @@ -770,14 +770,14 @@ Item { if (element.loaded) { if (!element.page) { element.page = invalidPageReplacement.createObject(root) - element.page.text = "\nError: The page has been deleted outside PageStack!" + element.page.text = "\nError: The page has been deleted outside StackView!" } return } if (!element.pageComponent) { element.page = invalidPageReplacement.createObject(root) element.page.text = "\nError: Invalid page (page was 'null'). " - + "This might indicate that the page was deleted outside PageStack!" + + "This might indicate that the page was deleted outside StackView!" return } @@ -787,7 +787,7 @@ Item { if (!element.properties) element.properties = {} element.properties.__index = element.index - element.properties.__pageStack = root + element.properties.__stackView = root if (comp.hasOwnProperty("createObject")) { if (comp.status === Component.Error) { @@ -818,7 +818,7 @@ Item { element.page.height = Qt.binding(function() { return root.height }) delete element.properties.__index - delete element.properties.__pageStack + delete element.properties.__stackView element.loaded = true } @@ -856,11 +856,11 @@ Item { if (element.destroyOnPop) { page.destroy() } else { - // Mark the page as no longer part of the PageStack. It + // Mark the page as no longer part of the StackView. It // might reenter on pop if pushed several times: page.visible = false __setPageStatus(page, Stack.Inactive) - page.Stack.__pageStack = null + page.Stack.__stackView = null page.Stack.__index = -1 if (element.originalParent) page.parent = element.originalParent @@ -889,7 +889,7 @@ Item { // Since a page can be pushed several times, we need to update its properties: enterPage.parent = root - enterPage.Stack.__pageStack = root + enterPage.Stack.__stackView = root enterPage.Stack.__index = transition.inElement.index __currentPage = enterPage @@ -921,11 +921,11 @@ Item { } if (!transition.animation) { - console.warn("Warning: PageStack: no", transition.name, "found!") + console.warn("Warning: StackView: no", transition.name, "found!") return } if (enterPage.anchors.fill || exitPage.anchors.fill) - console.warn("Warning: PageStack: cannot transition a page that is anchored!") + console.warn("Warning: StackView: cannot transition a page that is anchored!") __currentTransition = transition __setPageStatus(exitPage, Stack.Deactivating) diff --git a/src/controls/StackViewDelegate.qml b/src/controls/StackViewDelegate.qml index 070cce01d..0a3f25608 100644 --- a/src/controls/StackViewDelegate.qml +++ b/src/controls/StackViewDelegate.qml @@ -44,9 +44,9 @@ import QtQuick 2.1 \qmltype StackViewDelegate \inqmlmodule QtQuick.Controls 1.0 - \brief A delegate used by PageStack for loading transitions. + \brief A delegate used by StackView for loading transitions. - See the documentation for the \l {QtQuick.Controls1::PageStack} {PageStack} + See the documentation for the \l {QtQuick.Controls1::StackView} {StackView} component. */ diff --git a/src/controls/controls.pro b/src/controls/controls.pro index d395afa3f..a57e9991f 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -14,7 +14,7 @@ QML_FILES = \ Label.qml \ MenuBar.qml \ Menu.qml \ - PageStack.qml \ + StackView.qml \ ProgressBar.qml \ RadioButton.qml \ ScrollView.qml \ diff --git a/src/controls/qmldir b/src/controls/qmldir index 04c17f561..5a62f6525 100644 --- a/src/controls/qmldir +++ b/src/controls/qmldir @@ -8,7 +8,7 @@ GroupBox 1.0 GroupBox.qml Label 1.0 Label.qml MenuBar 1.0 MenuBar.qml Menu 1.0 Menu.qml -PageStack 1.0 PageStack.qml +StackView 1.0 StackView.qml ProgressBar 1.0 ProgressBar.qml RadioButton 1.0 RadioButton.qml ScrollView 1.0 ScrollView.qml diff --git a/src/controls/qtstack.cpp b/src/controls/qtstack.cpp index 2ca94115a..f3976d42f 100644 --- a/src/controls/qtstack.cpp +++ b/src/controls/qtstack.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE \instantiates QtStack \inqmlmodule QtQuick.Controls 1.0 \ingroup views - \brief Provides attached properties for items pushed onto a PageStack. + \brief Provides attached properties for items pushed onto a StackView. The Stack attached property provides information when an item becomes active or inactive through the \l{Stack::status}{Stack.status} property. @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE transition stops. When it leaves the screen, it will be \c Stack.Deactivating, and then \c Stack.Inactive. - \sa PageStack + \sa StackView */ QtStack::QtStack(QObject *object) @@ -77,8 +77,8 @@ QtStack *QtStack::qmlAttachedProperties(QObject *object) \readonly \qmlproperty int Stack::index - This property holds the index of the item inside \l{pageStack}{PageStack}, - so that \l{PageStack::get()}{pageStack.get(index)} will return the item itself. + This property holds the index of the item inside \l{pageStack}{StackView}, + so that \l{StackView::get()}{pageStack.get(index)} will return the item itself. If \l{Stack::pageStack}{pageStack} is \c null, \a index will be \c -1. */ int QtStack::index() const @@ -121,17 +121,17 @@ void QtStack::setStatus(Status status) /*! \readonly - \qmlproperty PageStack Stack::pageStack + \qmlproperty StackView Stack::pageStack - This property holds the PageStack the item is in. If the item is not inside - a PageStack, \a pageStack will be \c null. + This property holds the StackView the item is in. If the item is not inside + a StackView, \a pageStack will be \c null. */ QQuickItem *QtStack::pageStack() const { return m_pageStack; } -void QtStack::setPageStack(QQuickItem *pageStack) +void QtStack::setStackView(QQuickItem *pageStack) { if (m_pageStack != pageStack) { m_pageStack = pageStack; diff --git a/src/controls/qtstack_p.h b/src/controls/qtstack_p.h index d8f06aff8..3f9b79f55 100644 --- a/src/controls/qtstack_p.h +++ b/src/controls/qtstack_p.h @@ -54,7 +54,7 @@ class QtStack : public QObject Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(Status __status READ status WRITE setStatus NOTIFY statusChanged) Q_PROPERTY(QQuickItem* pageStack READ pageStack NOTIFY pageStackChanged) - Q_PROPERTY(QQuickItem* __pageStack READ pageStack WRITE setPageStack NOTIFY pageStackChanged) + Q_PROPERTY(QQuickItem* __stackView READ pageStack WRITE setStackView NOTIFY pageStackChanged) Q_ENUMS(Status) public: @@ -76,7 +76,7 @@ public: void setStatus(Status status); QQuickItem *pageStack() const; - void setPageStack(QQuickItem *pageStack); + void setStackView(QQuickItem *pageStack); signals: void statusChanged(); diff --git a/src/private/PageStack.js b/src/private/StackView.js similarity index 92% rename from src/private/PageStack.js rename to src/private/StackView.js index 7256e89e8..fa9bb08e8 100644 --- a/src/private/PageStack.js +++ b/src/private/StackView.js @@ -39,30 +39,30 @@ ** ****************************************************************************/ -var pageStack = []; +var stackView = []; function push(p) { if (!p) return - pageStack.push(p) + stackView.push(p) __depth++ return p } function pop() { - if (pageStack.length === 0) + if (stackView.length === 0) return null - var p = pageStack.pop() + var p = stackView.pop() __depth-- return p } function current() { - if (pageStack.length === 0) + if (stackView.length === 0) return null - return pageStack[pageStack.length-1] + return stackView[stackView.length-1] } diff --git a/src/private/private.pro b/src/private/private.pro index b5538a8a8..74a4a8f22 100644 --- a/src/private/private.pro +++ b/src/private/private.pro @@ -29,7 +29,7 @@ QML_FILES += \ Control.qml \ ModalPopupBehavior.qml \ StackViewSlideDelegate.qml \ - PageStack.js \ + StackView.js \ ScrollViewHelper.qml \ ScrollBar.qml \ FocusFrame.qml diff --git a/tests/auto/controls/data/tst_pagestack.qml b/tests/auto/controls/data/tst_pagestack.qml index f03235718..b20556fbd 100644 --- a/tests/auto/controls/data/tst_pagestack.qml +++ b/tests/auto/controls/data/tst_pagestack.qml @@ -44,7 +44,7 @@ import QtQuick.Controls 1.0 TestCase { id: testCase - name: "Tests_PageStack" + name: "Tests_StackView" when: windowShown width: 400 height: 400 @@ -57,7 +57,7 @@ TestCase { Component { id: stackComponent - PageStack {} + StackView {} } function test_pagestack() { diff --git a/tests/auto/controls/data/tst_stack.qml b/tests/auto/controls/data/tst_stack.qml index f51251e9f..fa833680f 100644 --- a/tests/auto/controls/data/tst_stack.qml +++ b/tests/auto/controls/data/tst_stack.qml @@ -59,7 +59,7 @@ TestCase { } function test_pageStack() { - var item = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; Item { property PageStack pageStack: Stack.pageStack }', testCase, ''); + var item = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; Item { property StackView pageStack: Stack.pageStack }', testCase, ''); compare(item.pageStack, null); } } diff --git a/tests/manual/PageStack.qml b/tests/manual/StackView.qml similarity index 83% rename from tests/manual/PageStack.qml rename to tests/manual/StackView.qml index 5d238ecc1..cf771be05 100644 --- a/tests/manual/PageStack.qml +++ b/tests/manual/StackView.qml @@ -46,8 +46,8 @@ Window { width: 480 height: 640 - PageStack { - id: pageStack + StackView { + id: stackView anchors.fill: parent initialPage: pageComponent } @@ -139,7 +139,7 @@ Window { height: parent.height Component.onDestruction: console.log("destroyed component page: " + Stack.index) property bool pushFromOnCompleted: false - Component.onCompleted: if (pushFromOnCompleted) pageStack.push(pageComponent) + Component.onCompleted: if (pushFromOnCompleted) stackView.push(pageComponent) Rectangle { anchors.fill: parent @@ -155,55 +155,55 @@ Window { Text { text:" " } Button { text: "Push component page" - onClicked: pageStack.push(pageComponent) + onClicked: stackView.push(pageComponent) } Button { text: "Push inline page" - onClicked: pageStack.push(pageInline) + onClicked: stackView.push(pageInline) } Button { text: "Push page as JS object" - onClicked: pageStack.push({page:pageComponent}) + onClicked: stackView.push({page:pageComponent}) } Button { text: "Push immediate" - onClicked: pageStack.push({page:pageComponent, immediate:true}) + onClicked: stackView.push({page:pageComponent, immediate:true}) } Button { text: "Push replace" - onClicked: pageStack.push({page:pageComponent, replace:true}) + onClicked: stackView.push({page:pageComponent, replace:true}) } Button { text: "Push inline page with destroyOnPop == true" - onClicked: pageStack.push({page:pageInline, destroyOnPop:true}) + onClicked: stackView.push({page:pageInline, destroyOnPop:true}) } Button { text: "Push component page with destroyOnPop == false" - onClicked: pageStack.push({page:pageComponent, destroyOnPop:false}) + onClicked: stackView.push({page:pageComponent, destroyOnPop:false}) } Button { text: "Push from Page.onCompleted" - onClicked: pageStack.push({page:pageComponent, properties:{pushFromOnCompleted:true}}) + onClicked: stackView.push({page:pageComponent, properties:{pushFromOnCompleted:true}}) } Button { text: "Pop" - onClicked: pageStack.pop() + onClicked: stackView.pop() } Button { text: "Pop(null)" - onClicked: pageStack.pop(null) + onClicked: stackView.pop(null) } Button { text: "Search for page 3, and pop down to it" - onClicked: pageStack.pop(pageStack.find(function(page) { if (page.Stack.index === 3) return true })) + onClicked: stackView.pop(stackView.find(function(page) { if (page.Stack.index === 3) return true })) } Button { text: "Search for page 3, and pop down to it (dontLoad == true)" - onClicked: pageStack.pop(pageStack.find(function(page) { if (page.Stack.index === 3) return true }, true)) + onClicked: stackView.pop(stackView.find(function(page) { if (page.Stack.index === 3) return true }, true)) } Button { text: "Clear" - onClicked: pageStack.clear() + onClicked: stackView.clear() } Button { text: "Push array of 100 pages" @@ -211,19 +211,19 @@ Window { var a = new Array for (var i=0; i<100; ++i) a.push(pageComponent) - pageStack.push(a) + stackView.push(a) } } Button { text: "Push 10 pages one by one" onClicked: { for (var i=0; i<10; ++i) - pageStack.push(pageComponent) + stackView.push(pageComponent) } } Button { text: "Complete transition" - onClicked: pageStack.completeTransition() + onClicked: stackView.completeTransition() } } } @@ -250,47 +250,47 @@ Window { } Button { text: "Push component page" - onClicked: pageStack.push(pageComponent) + onClicked: stackView.push(pageComponent) } Button { text: "Push inline page" - onClicked: pageStack.push(pageInline) + onClicked: stackView.push(pageInline) } Button { text: "Push page as JS object" - onClicked: pageStack.push({page:pageComponent}) + onClicked: stackView.push({page:pageComponent}) } Button { text: "Push immediate" - onClicked: pageStack.push({page:pageComponent, immediate:true}) + onClicked: stackView.push({page:pageComponent, immediate:true}) } Button { text: "Push inline page with destroyOnPop == true" - onClicked: pageStack.push({page:pageInline, destroyOnPop:true}) + onClicked: stackView.push({page:pageInline, destroyOnPop:true}) } Button { text: "Push component page with destroyOnPop == false" - onClicked: pageStack.push({page:pageComponent, destroyOnPop:false}) + onClicked: stackView.push({page:pageComponent, destroyOnPop:false}) } Button { text: "Pop" - onClicked: pageStack.pop() + onClicked: stackView.pop() } Button { text: "Pop(null)" - onClicked: pageStack.pop(null) + onClicked: stackView.pop(null) } Button { text: "Search for page 3, and pop down to it" - onClicked: pageStack.pop(pageStack.find(function(page) { if (pageInline.Stack.index === 3) return true })) + onClicked: stackView.pop(stackView.find(function(page) { if (pageInline.Stack.index === 3) return true })) } Button { text: "Search for page 3, and pop down to it (dontLoad == true)" - onClicked: pageStack.pop(pageStack.find(function(page) { if (pageInline.Stack.index === 3) return true }, true)) + onClicked: stackView.pop(stackView.find(function(page) { if (pageInline.Stack.index === 3) return true }, true)) } Button { text: "Clear" - onClicked: pageStack.clear() + onClicked: stackView.clear() } Button { text: "Push array of 100 pages" @@ -298,19 +298,19 @@ Window { var a = new Array for (var i=0; i<100; ++i) a.push(pageComponent) - pageStack.push(a) + stackView.push(a) } } Button { text: "Push 10 pages one by one" onClicked: { for (var i=0; i<10; ++i) - pageStack.push(pageComponent) + stackView.push(pageComponent) } } Button { text: "Complete transition" - onClicked: pageStack.completeTransition() + onClicked: stackView.completeTransition() } } } -- GitLab