diff --git a/examples/quick/controls/touch/content/ButtonPage.qml b/examples/quick/controls/touch/content/ButtonPage.qml index 635ce3b9926d5e721de8405659e581120bf063c3..f431a52e89addef25517e35cb870203b5e9237cc 100644 --- a/examples/quick/controls/touch/content/ButtonPage.qml +++ b/examples/quick/controls/touch/content/ButtonPage.qml @@ -86,7 +86,7 @@ Item { anchors.margins: 20 style: touchStyle text: "Dont press me" - onClicked: if (pageStack) pageStack.pop() + onClicked: if (stackView) stackView.pop() } } diff --git a/examples/quick/controls/touch/main.qml b/examples/quick/controls/touch/main.qml index 3058a0d3107eb2e6af03dc168a366609f5b9f2c6..9f93cb783eff0f2ff30a9bee7cc92089f741f77e 100644 --- a/examples/quick/controls/touch/main.qml +++ b/examples/quick/controls/touch/main.qml @@ -54,8 +54,8 @@ ApplicationWindow { // Implements back key navigation Keys.onReleased: { if (event.key === Qt.Key_Back) { - if (pageStack.depth > 1) { - pageStack.pop(); + if (stackView.depth > 1) { + stackView.pop(); event.accepted = true; } else { Qt.quit(); } } @@ -72,7 +72,7 @@ ApplicationWindow { width: opacity ? 60 : 0 anchors.left: parent.left anchors.leftMargin: 20 - opacity: pageStack.depth > 1 ? 1 : 0 + opacity: stackView.depth > 1 ? 1 : 0 anchors.verticalCenter: parent.verticalCenter antialiasing: true height: 60 @@ -87,7 +87,7 @@ ApplicationWindow { id: backmouse anchors.fill: parent anchors.margins: -10 - onClicked: pageStack.pop() + onClicked: stackView.pop() } } @@ -126,7 +126,7 @@ ApplicationWindow { } StackView { - id: pageStack + id: stackView anchors.fill: parent initialItem: Item { @@ -137,7 +137,7 @@ ApplicationWindow { anchors.fill: parent delegate: AndroidDelegate { text: title - onClicked: pageStack.push(Qt.resolvedUrl(page)) + onClicked: stackView.push(Qt.resolvedUrl(page)) } } } diff --git a/src/controls/StackView.qml b/src/controls/StackView.qml index c7b2366f2eb6b53a4115a62748ddc92a1fad0641..2c760e89eefdef81cccbd3d071b5d78e0c379b6e 100644 --- a/src/controls/StackView.qml +++ b/src/controls/StackView.qml @@ -797,7 +797,7 @@ Item { } element.item.Stack.__index = element.index - element.item.Stack.__stackView = root + element.item.Stack.__view = root // Let item fill all available space by default: element.item.width = Qt.binding(function() { return root.width }) element.item.height = Qt.binding(function() { return root.height }) @@ -842,7 +842,7 @@ Item { // might reenter on pop if pushed several times: item.visible = false __setStatus(item, Stack.Inactive) - item.Stack.__stackView = null + item.Stack.__view = null item.Stack.__index = -1 if (element.originalParent) item.parent = element.originalParent @@ -871,7 +871,7 @@ Item { // Since an item can be pushed several times, we need to update its properties: enterItem.parent = root - enterItem.Stack.__stackView = root + enterItem.Stack.__view = root enterItem.Stack.__index = transition.inElement.index __currentItem = enterItem diff --git a/src/controls/plugins.qmltypes b/src/controls/plugins.qmltypes index 8997cecfa5915bcc195267a532d3db0139256134..bd8508da54e7fde2fae50010ab9929a83d6b8bd1 100644 --- a/src/controls/plugins.qmltypes +++ b/src/controls/plugins.qmltypes @@ -199,7 +199,7 @@ Module { Property { name: "__index"; type: "int" } Property { name: "status"; type: "Status"; isReadonly: true } Property { name: "__status"; type: "Status" } - Property { name: "pageStack"; type: "QQuickItem"; isReadonly: true; isPointer: true } - Property { name: "__stackView"; type: "QQuickItem"; isPointer: true } + Property { name: "view"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "__view"; type: "QQuickItem"; isPointer: true } } } diff --git a/src/controls/qquickstack.cpp b/src/controls/qquickstack.cpp index 1723ef72dd7a6cfe6f7e0e9d5a21061ab9c55fcb..5d3accffdcffdee4b49b19811eab1d54ecd204a6 100644 --- a/src/controls/qquickstack.cpp +++ b/src/controls/qquickstack.cpp @@ -64,7 +64,7 @@ QQuickStack::QQuickStack(QObject *object) : QObject(object), m_index(-1), m_status(Inactive), - m_pageStack(0) + m_view(0) { } @@ -77,9 +77,9 @@ QQuickStack *QQuickStack::qmlAttachedProperties(QObject *object) \readonly \qmlproperty int Stack::index - 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. + This property holds the index of the item inside \l{view}{StackView}, + so that \l{StackView::get()}{StackView.get(index)} will return the item itself. + If \l{Stack::view}{view} is \c null, \a index will be \c -1. */ int QQuickStack::index() const { @@ -121,21 +121,21 @@ void QQuickStack::setStatus(Status status) /*! \readonly - \qmlproperty StackView Stack::pageStack + \qmlproperty StackView Stack::view This property holds the StackView the item is in. If the item is not inside - a StackView, \a pageStack will be \c null. + a StackView, \a view will be \c null. */ -QQuickItem *QQuickStack::pageStack() const +QQuickItem *QQuickStack::view() const { - return m_pageStack; + return m_view; } -void QQuickStack::setStackView(QQuickItem *pageStack) +void QQuickStack::setView(QQuickItem *view) { - if (m_pageStack != pageStack) { - m_pageStack = pageStack; - emit pageStackChanged(); + if (m_view != view) { + m_view = view; + emit viewChanged(); } } diff --git a/src/controls/qquickstack_p.h b/src/controls/qquickstack_p.h index a4b36644307f1f8ab152991f5b1c0e58d35ba191..c34dd1a3e55f990c53e92c57941b65f4dfe766a0 100644 --- a/src/controls/qquickstack_p.h +++ b/src/controls/qquickstack_p.h @@ -53,8 +53,8 @@ class QQuickStack : public QObject Q_PROPERTY(int __index READ index WRITE setIndex NOTIFY indexChanged) 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* __stackView READ pageStack WRITE setStackView NOTIFY pageStackChanged) + Q_PROPERTY(QQuickItem* view READ view NOTIFY viewChanged) + Q_PROPERTY(QQuickItem* __view READ view WRITE setView NOTIFY viewChanged) Q_ENUMS(Status) public: @@ -75,18 +75,18 @@ public: Status status() const; void setStatus(Status status); - QQuickItem *pageStack() const; - void setStackView(QQuickItem *pageStack); + QQuickItem *view() const; + void setView(QQuickItem *view); signals: void statusChanged(); - void pageStackChanged(); + void viewChanged(); void indexChanged(); private: int m_index; Status m_status; - QQuickItem *m_pageStack; + QQuickItem *m_view; }; QT_END_NAMESPACE diff --git a/tests/auto/controls/data/tst_stack.qml b/tests/auto/controls/data/tst_stack.qml index fa833680f649c984f224fda68e72d52e48b2db12..a7363de7a67ef943b272c94cfb6323ccdf53cca6 100644 --- a/tests/auto/controls/data/tst_stack.qml +++ b/tests/auto/controls/data/tst_stack.qml @@ -58,8 +58,8 @@ TestCase { compare(item.status, 0); // Stack.Inactive } - function test_pageStack() { - var item = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; Item { property StackView pageStack: Stack.pageStack }', testCase, ''); - compare(item.pageStack, null); + function test_view() { + var item = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; Item { property StackView view: Stack.view }', testCase, ''); + compare(item.view, null); } } diff --git a/tests/auto/controls/data/tst_pagestack.qml b/tests/auto/controls/data/tst_stackview.qml similarity index 96% rename from tests/auto/controls/data/tst_pagestack.qml rename to tests/auto/controls/data/tst_stackview.qml index b20556fbd8d6a0d5a9ca2a810cac9c7b2ce7941e..3daac7855ec0355cb1951ec9c010bebc5e694fea 100644 --- a/tests/auto/controls/data/tst_pagestack.qml +++ b/tests/auto/controls/data/tst_stackview.qml @@ -60,10 +60,10 @@ TestCase { StackView {} } - function test_pagestack() { + function test_stackview() { var component = stackComponent var stack = component.createObject(testCase); - verify (stack !== null, "pagestack created is null") + verify (stack !== null, "stackview created is null") verify (stack.depth === 0) stack.push(anItem) verify (stack.depth === 1)