Warning, /webapps/qmlonline/qml/examples/kirigami-pushpopclear.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick 2.1
0008 import QtQuick.Controls 2.15 as QQC2
0009 import org.kde.kirigami 2.4 as Kirigami
0010 
0011 Kirigami.ApplicationWindow {
0012     id: root
0013 
0014     globalDrawer: Kirigami.GlobalDrawer {
0015         title: "Hello App"
0016         titleIcon: "applications-graphics"
0017 
0018         actions: [
0019             Kirigami.Action {
0020                 text: "push"
0021                 onTriggered: pageStack.push(secondPageComponent)
0022             },
0023             Kirigami.Action {
0024                 text: "pop"
0025                 onTriggered: pageStack.pop()
0026             },
0027             Kirigami.Action {
0028                 text: "clear"
0029                 onTriggered: pageStack.clear()
0030             },
0031             Kirigami.Action {
0032                 text: "replace"
0033                 onTriggered: pageStack.replace(secondPageComponent)
0034             }
0035         ]
0036     }
0037 
0038     pageStack.initialPage: mainPageComponent
0039 
0040     Component {
0041         id: mainPageComponent
0042         Kirigami.Page {
0043             title: "First Page"
0044             Rectangle {
0045                 anchors.fill: parent
0046                 QQC2.Label {
0047                     text: "First Page"
0048                 }
0049             }
0050         }
0051     }
0052 
0053     Component {
0054         id: secondPageComponent
0055         Kirigami.Page {
0056             title: "Second Page"
0057             Rectangle {
0058                 color: "red"
0059                 anchors.fill: parent
0060                 QQC2.Label {
0061                     text: "Second Page"
0062                 }
0063             }
0064         }
0065     }
0066 
0067 }