Revision control

// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
- import shared as Examples
+ import QtQuick.Controls
- Item {
- height: 480
+ ApplicationWindow {
width: 320
- Examples.LauncherList {
- id: ll
+ height: 480
+ visible: true
+ title: qsTr("Views")
+
+ header: ToolBar {
+ visible: stack.depth > 1
+ height: visible ? implicitHeight : 0
+ ToolButton {
+ icon.source: "images/back.png"
+ Accessible.name: qsTr("Back")
+ onClicked: stack.pop()
+ }
+ }
+
+ StackView {
+ id: stack
anchors.fill: parent
- Component.onCompleted: {
- addExample("GridView", "A simple GridView", Qt.resolvedUrl("gridview/gridview-example.qml"))
- addExample("Dynamic List", "A dynamically alterable list", Qt.resolvedUrl("listview/dynamiclist.qml"))
- addExample("Expanding Delegates", "A ListView with delegates that expand", Qt.resolvedUrl("listview/expandingdelegates.qml"))
- addExample("Highlight", "A ListView with a custom highlight", Qt.resolvedUrl("listview/highlight.qml"))
- addExample("Highlight Ranges", "The three highlight ranges of ListView", Qt.resolvedUrl("listview/highlightranges.qml"))
- addExample("Sections", "ListView section headers and footers", Qt.resolvedUrl("listview/sections.qml"))
- addExample("Packages", "Transitions between a ListView and GridView", Qt.resolvedUrl("package/view.qml"))
- addExample("PathView", "A simple PathView", Qt.resolvedUrl("pathview/pathview-example.qml"))
- addExample("ObjectModel", "Using an ObjectModel", Qt.resolvedUrl("objectmodel/objectmodel.qml"))
- addExample("Display Margins", "A ListView with display margins", Qt.resolvedUrl("listview/displaymargin.qml"))
- addExample("Draggable Selections", "Enabling drag-and-drop on DelegateModel delegates", Qt.resolvedUrl("delegatemodel/dragselection.qml"))
+ focus: true
+ initialItem: LauncherList {
+ model: [
+ { name: "GridView", description: "A simple GridView", source: "gridview/gridview-example.qml" },
+ { name: "Dynamic List", description: "A dynamically alterable list", source: "listview/dynamiclist.qml" },
+ { name: "Expanding Delegates", description: "A ListView with delegates that expand", source: "listview/expandingdelegates.qml" },
+ { name: "Highlight", description: "A ListView with a custom highlight", source: "listview/highlight.qml" },
+ { name: "Highlight Ranges", description: "The three highlight ranges of ListView", source: "listview/highlightranges.qml" },
+ { name: "Sections", description: "ListView section headers and footers", source: "listview/sections.qml" },
+ { name: "Packages", description: "Transitions between a ListView and GridView", source: "package/view.qml" },
+ { name: "PathView", description: "A simple PathView", source: "pathview/pathview-example.qml" },
+ { name: "ObjectModel", description: "Using an ObjectModel", source: "objectmodel/objectmodel.qml" },
+ { name: "Display Margins", description: "A ListView with display margins", source: "listview/displaymargin.qml" },
+ { name: "Draggable Selections", description: "Enabling drag-and-drop on DelegateModel delegates", source: "delegatemodel/dragselection.qml" },
+ ]
+ onExampleClicked: (source) => stack.push(exampleLoader, { source })
+ }
+
+ Component {
+ id: exampleLoader
+ Loader {}
}
}
}