summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-03-22 13:51:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-26 20:30:48 +0100
commit64d33e6587282118256a873c6f9e07cb64d3e645 (patch)
treeecc959383dbcad69ef1a6521c32a132b9eadb942 /examples
parent7cbef2d8df5f4c39a91ab5942e7d7b5a44ad31f1 (diff)
downloadqtquickcontrols-64d33e6587282118256a873c6f9e07cb64d3e645.tar.gz
PageStack: add example application
Change-Id: I030a8cc918dc330aeab41843dc0f6f8def812944 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/examples.pro1
-rw-r--r--examples/stackview/ButtonMenu.qml61
-rw-r--r--examples/stackview/View.qml49
-rw-r--r--examples/stackview/main.qml65
-rw-r--r--examples/stackview/stackview.pro6
-rw-r--r--examples/stackview/stackview.qmlproject16
6 files changed, 198 insertions, 0 deletions
diff --git a/examples/examples.pro b/examples/examples.pro
index 37bdada2..e3c3a203 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -4,6 +4,7 @@ SUBDIRS += \
ApplicationTemplate \
gallery \
splitview \
+ stackview \
tableview \
text \
touch
diff --git a/examples/stackview/ButtonMenu.qml b/examples/stackview/ButtonMenu.qml
new file mode 100644
index 00000000..c1608f7e
--- /dev/null
+++ b/examples/stackview/ButtonMenu.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+
+Column {
+ property int index: -1
+ Label {
+ text: "stack index: " + index
+ }
+ Button {
+ text: "push Component"
+ onClicked: stackView.push(componentPage)
+ }
+ Button {
+ text: "push URL"
+ onClicked: stackView.push(Qt.resolvedUrl("View.qml"))
+ }
+ Button {
+ text: "pop"
+ onClicked: stackView.pop()
+ }
+}
diff --git a/examples/stackview/View.qml b/examples/stackview/View.qml
new file mode 100644
index 00000000..e713e0e5
--- /dev/null
+++ b/examples/stackview/View.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+
+Rectangle {
+ color: "green"
+ ButtonMenu {
+ index: parent.Stack.index
+ }
+}
diff --git a/examples/stackview/main.qml b/examples/stackview/main.qml
new file mode 100644
index 00000000..b1fb318a
--- /dev/null
+++ b/examples/stackview/main.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Quick Controls module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0
+
+ApplicationWindow {
+ width: 480
+ height: 640
+ property alias stackView: stackView
+ property alias componentPage: componentPage
+
+ PageStack {
+ id: stackView
+ anchors.fill: parent
+ initialPage: componentPage
+ }
+
+ Component {
+ id: componentPage
+ Rectangle {
+ color: "yellow"
+ ButtonMenu {
+ index: parent.Stack.index
+ }
+ }
+ }
+}
diff --git a/examples/stackview/stackview.pro b/examples/stackview/stackview.pro
new file mode 100644
index 00000000..9d02e4c7
--- /dev/null
+++ b/examples/stackview/stackview.pro
@@ -0,0 +1,6 @@
+TEMPLATE = aux
+
+OTHER_FILES += \
+ main.qml \
+ ButtonMenu.qml \
+ View.qml
diff --git a/examples/stackview/stackview.qmlproject b/examples/stackview/stackview.qmlproject
new file mode 100644
index 00000000..e5a8bf02
--- /dev/null
+++ b/examples/stackview/stackview.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "main.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+}