diff options
Diffstat (limited to 'examples/quick/controls/basiclayouts')
-rw-r--r-- | examples/quick/controls/basiclayouts/main.qml | 25 |
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() } } + } + } + } + } } } |