summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@theqtcompany.com>2015-03-04 16:22:00 +0100
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2015-04-13 11:33:54 +0000
commit9bf07e57bee62950ac44f67fb9ea4c31b71995c0 (patch)
tree35d8539d3f62a6a778f1b330941106048f71f0fd /examples
parent8b936debb8e60a573e9af895018ae5ab362e3c16 (diff)
downloadqtquickcontrols-9bf07e57bee62950ac44f67fb9ea4c31b71995c0.tar.gz
Say hello to StackLayout
Task-number: QTBUG-44077 Change-Id: I85dadc0950617728bca83d5c72ed5a086352b57d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/controls/basiclayouts/main.qml25
1 files changed, 24 insertions, 1 deletions
diff --git a/examples/quick/controls/basiclayouts/main.qml b/examples/quick/controls/basiclayouts/main.qml
index bc5ca214..b6694b45 100644
--- a/examples/quick/controls/basiclayouts/main.qml
+++ b/examples/quick/controls/basiclayouts/main.qml
@@ -40,7 +40,7 @@
import QtQuick 2.2
import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.0
+import QtQuick.Layouts 1.3
ApplicationWindow {
visible: true
@@ -108,5 +108,28 @@ ApplicationWindow {
Layout.fillHeight: true
Layout.fillWidth: true
}
+ GroupBox {
+ id: stackBox
+ title: "Stack layout"
+ implicitWidth: 200
+ implicitHeight: 60
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ StackLayout {
+ id: stackLayout
+ anchors.fill: parent
+
+ function advance() { currentIndex = (currentIndex + 1) % count }
+
+ Repeater {
+ id: stackRepeater
+ model: 5
+ Rectangle {
+ color: Qt.hsla((0.5 + index)/stackRepeater.count, 0.3, 0.7, 1)
+ Button { anchors.centerIn: parent; text: "Page " + (index + 1); onClicked: { stackLayout.advance() } }
+ }
+ }
+ }
+ }
}
}