summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@theqtcompany.com>2014-11-19 11:37:34 +0200
committerSamuli Piippo <samuli.piippo@theqtcompany.com>2014-11-19 15:55:56 +0200
commit9227b8deec263996ba623b0d4e085036842f089f (patch)
treeb2755f12c5e7084a605c6d532efbdb45f6e5845a
parentab757f82ba17f409052457a236ea7b5a2c53fc11 (diff)
Update enterprise-charts demo to QtCharts 2.0
The QtCharts module name was changed, so it was not backwards compatible. Updated all demo files from QtCharts. Task-number: QTEE-807 Change-Id: I1c00ccaf074b0a704af92506da57b723987de359 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@theqtcompany.com>
-rw-r--r--basicsuite/enterprise-charts/View1.qml18
-rw-r--r--basicsuite/enterprise-charts/View10.qml18
-rw-r--r--basicsuite/enterprise-charts/View11.qml18
-rw-r--r--basicsuite/enterprise-charts/View12.qml81
-rw-r--r--basicsuite/enterprise-charts/View13.qml87
-rw-r--r--basicsuite/enterprise-charts/View14.qml74
-rw-r--r--basicsuite/enterprise-charts/View15.qml77
-rw-r--r--basicsuite/enterprise-charts/View2.qml18
-rw-r--r--basicsuite/enterprise-charts/View3.qml18
-rw-r--r--basicsuite/enterprise-charts/View4.qml19
-rw-r--r--basicsuite/enterprise-charts/View5.qml19
-rw-r--r--basicsuite/enterprise-charts/View6.qml18
-rw-r--r--basicsuite/enterprise-charts/View7.qml18
-rw-r--r--basicsuite/enterprise-charts/View8.qml18
-rw-r--r--basicsuite/enterprise-charts/View9.qml18
-rw-r--r--basicsuite/enterprise-charts/loader.qml2
-rw-r--r--basicsuite/enterprise-charts/main.qml105
17 files changed, 184 insertions, 442 deletions
diff --git a/basicsuite/enterprise-charts/View1.qml b/basicsuite/enterprise-charts/View1.qml
index e245cef..bda55ff 100644
--- a/basicsuite/enterprise-charts/View1.qml
+++ b/basicsuite/enterprise-charts/View1.qml
@@ -2,26 +2,24 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
//![2]
import QtQuick 2.0
//![2]
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View10.qml b/basicsuite/enterprise-charts/View10.qml
index ede5d50..91cf7f1 100644
--- a/basicsuite/enterprise-charts/View10.qml
+++ b/basicsuite/enterprise-charts/View10.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View11.qml b/basicsuite/enterprise-charts/View11.qml
index d08fb7b..fb9c145 100644
--- a/basicsuite/enterprise-charts/View11.qml
+++ b/basicsuite/enterprise-charts/View11.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View12.qml b/basicsuite/enterprise-charts/View12.qml
index 9a48af8..86ce0e3 100644
--- a/basicsuite/enterprise-charts/View12.qml
+++ b/basicsuite/enterprise-charts/View12.qml
@@ -2,66 +2,73 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.3
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
+
//![1]
- PolarChartView {
- title: "Two Series, Common Axes"
+ ChartView {
+ id: chart
+ title: "Production costs"
anchors.fill: parent
legend.visible: false
+ antialiasing: true
- ValueAxis {
- id: axisAngular
- min: 0
- max: 20
- tickCount: 9
+ PieSeries {
+ id: pieOuter
+ size: 0.96
+ holeSize: 0.7
+ PieSlice { id: slice; label: "Alpha"; value: 19511; color: "#8AB846"; borderColor: "#163430" }
+ PieSlice { label: "Epsilon"; value: 11105; color: "#C0EEFF"; borderColor: "#3B391C" }
+ PieSlice { label: "Psi"; value: 9352; color: "#DF8939"; borderColor: "#13060C" }
}
- ValueAxis {
- id: axisRadial
- min: -0.5
- max: 1.5
- }
+ PieSeries {
+ size: 0.7
+ id: pieInner
+ holeSize: 0.25
- SplineSeries {
- id: series1
- axisAngular: axisAngular
- axisRadial: axisRadial
- pointsVisible: true
- }
+ PieSlice { label: "Materials"; value: 10334; color: "#8AB846"; borderColor: "#163430" }
+ PieSlice { label: "Employee"; value: 3066; color: "#AAE356"; borderColor: "#163430" }
+ PieSlice { label: "Logistics"; value: 6111; color: "#99CC4E"; borderColor: "#163430" }
- ScatterSeries {
- id: series2
- axisAngular: axisAngular
- axisRadial: axisRadial
- markerSize: 10
+ PieSlice { label: "Materials"; value: 7371; color: "#C0EEFF"; borderColor: "#3B391C" }
+ PieSlice { label: "Employee"; value: 2443; color: "#C9FAFF"; borderColor: "#3B391C" }
+ PieSlice { label: "Logistics"; value: 1291; color: "#B0FAFF"; borderColor: "#3B391C" }
+
+ PieSlice { label: "Materials"; value: 4022; color: "#DF8939"; borderColor: "#13060C" }
+ PieSlice { label: "Employee"; value: 3998; color: "#FC9D42"; borderColor: "#13060C" }
+ PieSlice { label: "Logistics"; value: 1332; color: "#F2963F"; borderColor: "#13060C" }
}
}
- // Add data dynamically to the series
Component.onCompleted: {
- for (var i = 0; i <= 20; i++) {
- series1.append(i, Math.random());
- series2.append(i, Math.random());
+ // Set the common slice properties dynamically for convenience
+ for (var i = 0; i < pieOuter.count; i++) {
+ pieOuter.at(i).labelPosition = PieSlice.LabelOutside;
+ pieOuter.at(i).labelVisible = true;
+ pieOuter.at(i).borderWidth = 3;
+ }
+ for (var i = 0; i < pieInner.count; i++) {
+ pieInner.at(i).labelPosition = PieSlice.LabelInsideNormal;
+ pieInner.at(i).labelVisible = true;
+ pieInner.at(i).borderWidth = 2;
}
}
//![1]
diff --git a/basicsuite/enterprise-charts/View13.qml b/basicsuite/enterprise-charts/View13.qml
deleted file mode 100644
index 610cce1..0000000
--- a/basicsuite/enterprise-charts/View13.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
-**
-** This file is part of the Qt Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtCommercial.Chart 1.3
-
-Rectangle {
- anchors.fill: parent
-
- PolarChartView {
- title: "Historical Area Series"
- anchors.fill: parent
- legend.visible: false
-
- DateTimeAxis {
- id: axis1
- format: "yyyy MMM"
- tickCount: 13
- }
- ValueAxis {
- id: axis2
- }
- LineSeries {
- id: lowerLine
- axisAngular: axis1
- axisRadial: axis2
-
- // Please note that month in JavaScript months are zero based, so 2 means March
- XYPoint { x: toMsecsSinceEpoch(new Date(1950, 0, 1)); y: 15 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1962, 4, 1)); y: 35 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 50 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1978, 2, 1)); y: 75 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1987, 11, 1)); y: 102 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1992, 1, 1)); y: 132 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 100 }
- XYPoint { x: toMsecsSinceEpoch(new Date(2002, 4, 1)); y: 120 }
- XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 1)); y: 140 }
- XYPoint { x: toMsecsSinceEpoch(new Date(2013, 5, 1)); y: 150 }
- }
- LineSeries {
- id: upperLine
- axisAngular: axis1
- axisRadial: axis2
-
- // Please note that month in JavaScript months are zero based, so 2 means March
- XYPoint { x: toMsecsSinceEpoch(new Date(1950, 0, 1)); y: 30 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1962, 4, 1)); y: 55 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 80 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1978, 2, 1)); y: 105 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1987, 11, 1)); y: 125 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1992, 1, 1)); y: 160 }
- XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 140 }
- XYPoint { x: toMsecsSinceEpoch(new Date(2002, 4, 1)); y: 140 }
- XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 1)); y: 170 }
- XYPoint { x: toMsecsSinceEpoch(new Date(2013, 5, 1)); y: 200 }
- }
- AreaSeries {
- axisAngular: axis1
- axisRadial: axis2
- lowerSeries: lowerLine
- upperSeries: upperLine
- }
- }
- // DateTimeAxis is based on QDateTimes so we must convert our JavaScript dates to
- // milliseconds since epoch to make them match the DateTimeAxis values
- function toMsecsSinceEpoch(date) {
- var msecs = date.getTime();
- return msecs;
- }
-}
diff --git a/basicsuite/enterprise-charts/View14.qml b/basicsuite/enterprise-charts/View14.qml
deleted file mode 100644
index 467a4a5..0000000
--- a/basicsuite/enterprise-charts/View14.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
-**
-** This file is part of the Qt Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtCommercial.Chart 1.3
-
-Rectangle {
- anchors.fill: parent
-
- PolarChartView {
- title: "Numerical Data for Dummies"
- anchors.fill: parent
- legend.visible: false
-
- LineSeries {
- axisRadial: CategoryAxis {
- min: 0
- max: 30
- CategoryRange {
- label: "critical"
- endValue: 2
- }
- CategoryRange {
- label: "low"
- endValue: 7
- }
- CategoryRange {
- label: "normal"
- endValue: 12
- }
- CategoryRange {
- label: "high"
- endValue: 18
- }
- CategoryRange {
- label: "extremely high"
- endValue: 30
- }
- }
-
- axisAngular: ValueAxis {
- tickCount: 13
- }
-
- XYPoint { x: 0; y: 4.3 }
- XYPoint { x: 1; y: 4.1 }
- XYPoint { x: 2; y: 4.7 }
- XYPoint { x: 3; y: 3.9 }
- XYPoint { x: 4; y: 5.2 }
- XYPoint { x: 5; y: 5.3 }
- XYPoint { x: 6; y: 6.1 }
- XYPoint { x: 7; y: 7.7 }
- XYPoint { x: 8; y: 12.9 }
- XYPoint { x: 9; y: 19.2 }
- }
- }
-}
diff --git a/basicsuite/enterprise-charts/View15.qml b/basicsuite/enterprise-charts/View15.qml
deleted file mode 100644
index 8aff22b..0000000
--- a/basicsuite/enterprise-charts/View15.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
-**
-** This file is part of the Qt Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtCommercial.Chart 1.1
-
-Rectangle {
- anchors.fill: parent
-
- //![1]
- ChartView {
- id: chart
- title: "Production costs"
- anchors.fill: parent
- legend.visible: false
- antialiasing: true
-
- PieSeries {
- id: pieOuter
- size: 0.96
- holeSize: 0.7
- PieSlice { id: slice; label: "Alpha"; value: 19511; color: "#8AB846"; borderColor: "#163430" }
- PieSlice { label: "Epsilon"; value: 11105; color: "#C0EEFF"; borderColor: "#3B391C" }
- PieSlice { label: "Psi"; value: 9352; color: "#DF8939"; borderColor: "#13060C" }
- }
-
- PieSeries {
- size: 0.7
- id: pieInner
- holeSize: 0.25
-
- PieSlice { label: "Materials"; value: 10334; color: "#8AB846"; borderColor: "#163430" }
- PieSlice { label: "Employee"; value: 3066; color: "#AAE356"; borderColor: "#163430" }
- PieSlice { label: "Logistics"; value: 6111; color: "#99CC4E"; borderColor: "#163430" }
-
- PieSlice { label: "Materials"; value: 7371; color: "#C0EEFF"; borderColor: "#3B391C" }
- PieSlice { label: "Employee"; value: 2443; color: "#C9FAFF"; borderColor: "#3B391C" }
- PieSlice { label: "Logistics"; value: 1291; color: "#B0FAFF"; borderColor: "#3B391C" }
-
- PieSlice { label: "Materials"; value: 4022; color: "#DF8939"; borderColor: "#13060C" }
- PieSlice { label: "Employee"; value: 3998; color: "#FC9D42"; borderColor: "#13060C" }
- PieSlice { label: "Logistics"; value: 1332; color: "#F2963F"; borderColor: "#13060C" }
- }
- }
-
- Component.onCompleted: {
- // Set the common slice properties dynamically for convenience
- for (var i = 0; i < pieOuter.count; i++) {
- pieOuter.at(i).labelPosition = PieSlice.LabelOutside;
- pieOuter.at(i).labelVisible = true;
- pieOuter.at(i).borderWidth = 3;
- }
- for (var i = 0; i < pieInner.count; i++) {
- pieInner.at(i).labelPosition = PieSlice.LabelInsideNormal;
- pieInner.at(i).labelVisible = true;
- pieInner.at(i).borderWidth = 2;
- }
- }
- //![1]
-}
diff --git a/basicsuite/enterprise-charts/View2.qml b/basicsuite/enterprise-charts/View2.qml
index 73e1c9c..092e64b 100644
--- a/basicsuite/enterprise-charts/View2.qml
+++ b/basicsuite/enterprise-charts/View2.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View3.qml b/basicsuite/enterprise-charts/View3.qml
index 839551d..716bd6e 100644
--- a/basicsuite/enterprise-charts/View3.qml
+++ b/basicsuite/enterprise-charts/View3.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View4.qml b/basicsuite/enterprise-charts/View4.qml
index 49dc1b9..e3c28a3 100644
--- a/basicsuite/enterprise-charts/View4.qml
+++ b/basicsuite/enterprise-charts/View4.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
@@ -59,7 +57,6 @@ Rectangle {
XYPoint { x: 2011; y: 1 }
}
}
- // ...
//![1]
AreaSeries {
diff --git a/basicsuite/enterprise-charts/View5.qml b/basicsuite/enterprise-charts/View5.qml
index 2a99c3a..99aeef5 100644
--- a/basicsuite/enterprise-charts/View5.qml
+++ b/basicsuite/enterprise-charts/View5.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
@@ -44,7 +42,6 @@ Rectangle {
ScatterSeries {
name: "Scatter2"
- // ...
//![1]
XYPoint { x: 2.0; y: 2.0 }
XYPoint { x: 2.0; y: 2.1 }
diff --git a/basicsuite/enterprise-charts/View6.qml b/basicsuite/enterprise-charts/View6.qml
index 1669274..10daa41 100644
--- a/basicsuite/enterprise-charts/View6.qml
+++ b/basicsuite/enterprise-charts/View6.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View7.qml b/basicsuite/enterprise-charts/View7.qml
index 96fc2e7..d876a6a 100644
--- a/basicsuite/enterprise-charts/View7.qml
+++ b/basicsuite/enterprise-charts/View7.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View8.qml b/basicsuite/enterprise-charts/View8.qml
index 9ec4d5d..81dfd80 100644
--- a/basicsuite/enterprise-charts/View8.qml
+++ b/basicsuite/enterprise-charts/View8.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/View9.qml b/basicsuite/enterprise-charts/View9.qml
index 3e3d0fb..44ae97c 100644
--- a/basicsuite/enterprise-charts/View9.qml
+++ b/basicsuite/enterprise-charts/View9.qml
@@ -2,24 +2,22 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
import QtQuick 2.0
-import QtCommercial.Chart 1.1
+import QtCharts 2.0
Rectangle {
anchors.fill: parent
diff --git a/basicsuite/enterprise-charts/loader.qml b/basicsuite/enterprise-charts/loader.qml
index 42198e4..1135479 100644
--- a/basicsuite/enterprise-charts/loader.qml
+++ b/basicsuite/enterprise-charts/loader.qml
@@ -30,7 +30,7 @@ Item {
var o = co.createObject(container)
} else {
console.log(co.errorString())
- console.log("QtCommercial.Chart 1.1 not available")
+ console.log("QtCharts 2.0 not available")
console.log("Please use correct QML_IMPORT_PATH export")
}
}
diff --git a/basicsuite/enterprise-charts/main.qml b/basicsuite/enterprise-charts/main.qml
index a500bd9..495a2f3 100644
--- a/basicsuite/enterprise-charts/main.qml
+++ b/basicsuite/enterprise-charts/main.qml
@@ -2,19 +2,17 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://www.qt.io
+** For any questions to Digia, please use contact form at http://qt.io
**
-** This file is part of the Qt Enterprise Charts Add-on.
+** This file is part of the Qt Charts module.
**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
+** Licensees holding valid commercial license for Qt may use this file in
+** accordance with the Qt License Agreement provided with the Software
+** or, alternatively, in accordance with the terms contained in a written
+** agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://www.qt.io
-** $QT_END_LICENSE$
+** contact form at http://qt.io
**
****************************************************************************/
@@ -25,12 +23,51 @@ import QtQuick 2.0
Rectangle {
width: 600
height: 400
- property int viewNumber: 1
+ property bool sourceLoaded: false
- Loader {
- id: loader
+ ListView {
+ id: root
+ focus: true
anchors.fill: parent
- source: "View" + viewNumber + ".qml";
+ 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"}
+ ListElement {component: "View4.qml"}
+ ListElement {component: "View5.qml"}
+ ListElement {component: "View6.qml"}
+ ListElement {component: "View7.qml"}
+ ListElement {component: "View8.qml"}
+ ListElement {component: "View9.qml"}
+ ListElement {component: "View10.qml"}
+ ListElement {component: "View11.qml"}
+ ListElement {component: "View12.qml"}
+ }
+
+ delegate: Loader {
+ width: root.width
+ height: root.height
+
+ source: component
+ asynchronous: true
+
+ onLoaded: sourceLoaded = true
+ }
}
Rectangle {
@@ -42,51 +79,11 @@ Rectangle {
Text {
color: "white"
anchors.centerIn: parent
- text: "Use left and right arrow keys or tap on the screen to navigate between chart types"
+ text: "You can navigate between views using swipe or arrow keys"
}
Behavior on opacity {
NumberAnimation { duration: 400 }
}
}
-
- MouseArea {
- focus: true
- anchors.fill: parent
- onClicked: {
- if (infoText.opacity > 0) {
- infoText.opacity = 0.0;
- } else {
- nextView();
- }
- }
- Keys.onPressed: {
- if (infoText.opacity > 0) {
- infoText.opacity = 0.0;
- } else {
- if (event.key == Qt.Key_Left) {
- previousView();
- } else {
- // tapping on the screen advances to the next view
- nextView();
- }
- }
- }
- }
-
- function nextView() {
- var i = viewNumber + 1;
- if (i > 15)
- viewNumber = 1;
- else
- viewNumber = i;
- }
-
- function previousView() {
- var i = viewNumber - 1;
- if (i <= 0)
- viewNumber = 15;
- else
- viewNumber = i;
- }
}