aboutsummaryrefslogtreecommitdiffstats
path: root/examples/charts/qmlpolarchart/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/qmlpolarchart/main.qml')
-rw-r--r--examples/charts/qmlpolarchart/main.qml63
1 files changed, 63 insertions, 0 deletions
diff --git a/examples/charts/qmlpolarchart/main.qml b/examples/charts/qmlpolarchart/main.qml
new file mode 100644
index 000000000..6ced27ee2
--- /dev/null
+++ b/examples/charts/qmlpolarchart/main.qml
@@ -0,0 +1,63 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+import QtQuick
+
+Item {
+ width: 800
+ height: 600
+ property bool sourceLoaded: false
+
+ ListView {
+ id: root
+ focus: true
+ anchors.fill: parent
+ snapMode: ListView.SnapOneItem
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ highlightMoveDuration: 250
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+
+ onCurrentIndexChanged: {
+ if (infoText.opacity > 0.0) {
+ if (sourceLoaded)
+ infoText.opacity = 0.0;
+ else if (currentIndex != 0)
+ currentIndex = 0;
+ }
+ }
+
+ model: ListModel {
+ ListElement {component: "View1.qml"}
+ ListElement {component: "View2.qml"}
+ ListElement {component: "View3.qml"}
+ }
+
+ delegate: Loader {
+ width: root.width
+ height: root.height
+
+ source: component
+ asynchronous: true
+
+ onLoaded: sourceLoaded = true
+ }
+ }
+
+ Rectangle {
+ id: infoText
+ anchors.centerIn: parent
+ width: parent.width
+ height: 40
+ color: "black"
+ Text {
+ color: "white"
+ anchors.centerIn: parent
+ text: "You can navigate between views using swipe or arrow keys"
+ }
+
+ Behavior on opacity {
+ NumberAnimation { duration: 400 }
+ }
+ }
+}