@@ -0,0 +1,107 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest BarCategoryAxis 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_minMax() { | |||
|
35 | compare(barSeries1.axisX.min, "Jan", "AxisX min"); | |||
|
36 | compare(barSeries1.axisX.max, "Jun", "AxisX max"); | |||
|
37 | compare(barSeries1.axisY.min, 0, "AxisY min"); | |||
|
38 | compare(barSeries1.axisY.max, 10, "AxisY max"); | |||
|
39 | } | |||
|
40 | ||||
|
41 | function test_categories() { | |||
|
42 | compare(barSeries1.axisX.count, 6, "AxisX count"); | |||
|
43 | categoriesCountChangedSpy.clear(); | |||
|
44 | categoriesChangedSpy.clear(); | |||
|
45 | ||||
|
46 | // Replace categories | |||
|
47 | barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"]; | |||
|
48 | compare(barSeries1.axisX.count, 4, "AxisX count"); | |||
|
49 | compare(categoriesCountChangedSpy.count, 1, "onCountChanged"); | |||
|
50 | compare(categoriesChangedSpy.count, 1, "onCategoriesChanged"); | |||
|
51 | ||||
|
52 | // Reset the original categories | |||
|
53 | barSeries1.axisX.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] | |||
|
54 | compare(barSeries1.axisX.count, 6, "AxisX count"); | |||
|
55 | compare(categoriesCountChangedSpy.count, 2, "onCountChanged"); | |||
|
56 | compare(categoriesChangedSpy.count, 2, "onCategoriesChanged"); | |||
|
57 | } | |||
|
58 | ||||
|
59 | function test_minMaxChanged() { | |||
|
60 | axisY.min = -1; | |||
|
61 | compare(minChangedSpy.count, 1, "onMinChanged"); | |||
|
62 | compare(maxChangedSpy.count, 0, "onMaxChanged"); | |||
|
63 | axisY.max = 12; | |||
|
64 | compare(minChangedSpy.count, 1, "onMinChanged"); | |||
|
65 | compare(maxChangedSpy.count, 1, "onMaxChanged"); | |||
|
66 | } | |||
|
67 | } | |||
|
68 | ||||
|
69 | ChartView { | |||
|
70 | id: chartView | |||
|
71 | anchors.fill: parent | |||
|
72 | ||||
|
73 | BarSeries { | |||
|
74 | id: barSeries1 | |||
|
75 | axisX: BarCategoryAxis { | |||
|
76 | id: axisX | |||
|
77 | categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ] | |||
|
78 | } | |||
|
79 | axisY: ValuesAxis { | |||
|
80 | id: axisY | |||
|
81 | min: 0 | |||
|
82 | max: 10 | |||
|
83 | } | |||
|
84 | } | |||
|
85 | ||||
|
86 | SignalSpy { | |||
|
87 | id: categoriesCountChangedSpy | |||
|
88 | target: axisX | |||
|
89 | signalName: "countChanged" | |||
|
90 | } | |||
|
91 | SignalSpy { | |||
|
92 | id: categoriesChangedSpy | |||
|
93 | target: axisX | |||
|
94 | signalName: "categoriesChanged" | |||
|
95 | } | |||
|
96 | SignalSpy { | |||
|
97 | id: minChangedSpy | |||
|
98 | target: axisY | |||
|
99 | signalName: "minChanged" | |||
|
100 | } | |||
|
101 | SignalSpy { | |||
|
102 | id: maxChangedSpy | |||
|
103 | target: axisY | |||
|
104 | signalName: "maxChanged" | |||
|
105 | } | |||
|
106 | } | |||
|
107 | } |
@@ -0,0 +1,146 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest BarSeries 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_properties() { | |||
|
35 | compare(barSeries.barWidth, 0.5); | |||
|
36 | compare(barSeries.labelsVisible, false); | |||
|
37 | } | |||
|
38 | ||||
|
39 | function test_axes() { | |||
|
40 | verify(chartView.axisX() == barSeries.axisX); | |||
|
41 | verify(chartView.axisY() == barSeries.axisY); | |||
|
42 | ||||
|
43 | compare(barSeries.axisX, stackedBarSeries.axisX); | |||
|
44 | compare(barSeries.axisY, stackedBarSeries.axisY); | |||
|
45 | ||||
|
46 | compare(barSeries.axisX, percentBarSeries.axisX); | |||
|
47 | compare(barSeries.axisY, percentBarSeries.axisY); | |||
|
48 | } | |||
|
49 | ||||
|
50 | function test_append() { | |||
|
51 | var setCount = 5; | |||
|
52 | var valueCount = 50; | |||
|
53 | addedSpy.clear(); | |||
|
54 | append(setCount, valueCount); | |||
|
55 | ||||
|
56 | compare(barSeries.count, setCount); | |||
|
57 | for (var k = 0; k < setCount; k++) { | |||
|
58 | compare(barSeries.at(k).count, valueCount); | |||
|
59 | compare(barSeries.at(k).label, "barset" + k); | |||
|
60 | } | |||
|
61 | compare(addedSpy.count, setCount); | |||
|
62 | ||||
|
63 | barSeries.clear(); | |||
|
64 | compare(barSeries.count, 0); | |||
|
65 | } | |||
|
66 | ||||
|
67 | function test_insert() { | |||
|
68 | var setCount = 5; | |||
|
69 | var valueCount = 50; | |||
|
70 | addedSpy.clear(); | |||
|
71 | append(setCount, valueCount); | |||
|
72 | ||||
|
73 | for (var i = 0; i < setCount; i++) { | |||
|
74 | var values = []; | |||
|
75 | for (var j = 0; j < valueCount; j++) | |||
|
76 | values[j] = Math.random() * 10; | |||
|
77 | var set = barSeries.insert(i, "barset" + i, values); | |||
|
78 | compare(set.label, "barset" + i); | |||
|
79 | } | |||
|
80 | ||||
|
81 | compare(barSeries.count, setCount * 2); | |||
|
82 | for (var k = 0; k < setCount * 2; k++) | |||
|
83 | compare(barSeries.at(k).count, valueCount); | |||
|
84 | compare(addedSpy.count, 2 * setCount); | |||
|
85 | ||||
|
86 | barSeries.clear(); | |||
|
87 | compare(barSeries.count, 0); | |||
|
88 | } | |||
|
89 | ||||
|
90 | function test_remove() { | |||
|
91 | var setCount = 5; | |||
|
92 | var valueCount = 50; | |||
|
93 | removedSpy.clear(); | |||
|
94 | append(setCount, valueCount); | |||
|
95 | ||||
|
96 | for (var k = 0; k < setCount; k++) | |||
|
97 | barSeries.remove(barSeries.at(0)); | |||
|
98 | ||||
|
99 | compare(barSeries.count, 0); | |||
|
100 | compare(removedSpy.count, setCount); | |||
|
101 | } | |||
|
102 | ||||
|
103 | // Not a test function, used by one or more test functions | |||
|
104 | function append(setCount, valueCount) { | |||
|
105 | for (var i = 0; i < setCount; i++) { | |||
|
106 | var values = []; | |||
|
107 | for (var j = 0; j < valueCount; j++) | |||
|
108 | values[j] = Math.random() * 10; | |||
|
109 | barSeries.append("barset" + i, values); | |||
|
110 | } | |||
|
111 | } | |||
|
112 | } | |||
|
113 | ||||
|
114 | ChartView { | |||
|
115 | id: chartView | |||
|
116 | anchors.fill: parent | |||
|
117 | ||||
|
118 | BarSeries { | |||
|
119 | id: barSeries | |||
|
120 | name: "bar" | |||
|
121 | axisX: BarCategoryAxis {} | |||
|
122 | axisY: ValueAxis { min: 0; max: 10 } | |||
|
123 | ||||
|
124 | SignalSpy { | |||
|
125 | id: addedSpy | |||
|
126 | target: barSeries | |||
|
127 | signalName: "barsetsAdded" | |||
|
128 | } | |||
|
129 | SignalSpy { | |||
|
130 | id: removedSpy | |||
|
131 | target: barSeries | |||
|
132 | signalName: "barsetsRemoved" | |||
|
133 | } | |||
|
134 | } | |||
|
135 | ||||
|
136 | StackedBarSeries { | |||
|
137 | id: stackedBarSeries | |||
|
138 | name: "stackedBar" | |||
|
139 | } | |||
|
140 | ||||
|
141 | PercentBarSeries { | |||
|
142 | id: percentBarSeries | |||
|
143 | name: "percentBar" | |||
|
144 | } | |||
|
145 | } | |||
|
146 | } |
@@ -0,0 +1,96 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest BoxPlotSeries 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_properties() { | |||
|
35 | compare(boxPlotSeries.boxWidth, 0.5); | |||
|
36 | } | |||
|
37 | ||||
|
38 | function test_setproperties() { | |||
|
39 | var set = boxPlotSeries.append("boxplot", [1, 2, 5, 6, 8]); | |||
|
40 | compare(set.label, "boxplot"); | |||
|
41 | compare(set.count, 5); | |||
|
42 | } | |||
|
43 | ||||
|
44 | function test_append() { | |||
|
45 | addedSpy.clear(); | |||
|
46 | countChangedSpy.clear(); | |||
|
47 | var count = 50; | |||
|
48 | for (var i = 0; i < count; i++) | |||
|
49 | boxPlotSeries.append("boxplot" + i, Math.random()); | |||
|
50 | compare(addedSpy.count, count); | |||
|
51 | compare(countChangedSpy.count, count); | |||
|
52 | console.log("Check the series count once QTRD-2504 is implemented"); | |||
|
53 | boxPlotSeries.clear(); | |||
|
54 | } | |||
|
55 | ||||
|
56 | function test_remove() { | |||
|
57 | removedSpy.clear(); | |||
|
58 | countChangedSpy.clear(); | |||
|
59 | var count = 50; | |||
|
60 | for (var i = 0; i < count; i++) | |||
|
61 | boxPlotSeries.append("boxplot" + i, Math.random()); | |||
|
62 | for (var j = 0; j < count; j++) | |||
|
63 | boxPlotSeries.remove(boxPlotSeries.at(0)); | |||
|
64 | compare(removedSpy.count, count); | |||
|
65 | compare(countChangedSpy.count, 2 * count); | |||
|
66 | console.log("Check the series count once QTRD-2504 is implemented"); | |||
|
67 | } | |||
|
68 | } | |||
|
69 | ||||
|
70 | ChartView { | |||
|
71 | id: chartView | |||
|
72 | anchors.fill: parent | |||
|
73 | ||||
|
74 | BoxPlotSeries { | |||
|
75 | id: boxPlotSeries | |||
|
76 | name: "boxplot" | |||
|
77 | BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] } | |||
|
78 | ||||
|
79 | SignalSpy { | |||
|
80 | id: addedSpy | |||
|
81 | target: boxPlotSeries | |||
|
82 | signalName: "boxsetsAdded" | |||
|
83 | } | |||
|
84 | SignalSpy { | |||
|
85 | id: removedSpy | |||
|
86 | target: boxPlotSeries | |||
|
87 | signalName: "boxsetsRemoved" | |||
|
88 | } | |||
|
89 | SignalSpy { | |||
|
90 | id: countChangedSpy | |||
|
91 | target: boxPlotSeries | |||
|
92 | signalName: "countChanged" | |||
|
93 | } | |||
|
94 | } | |||
|
95 | } | |||
|
96 | } |
@@ -0,0 +1,84 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest CategoryAxis 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_minMax() { | |||
|
35 | compare(lineSeries1.axisX.min, 0, "AxisX min"); | |||
|
36 | compare(lineSeries1.axisX.max, 10, "AxisX max"); | |||
|
37 | compare(lineSeries1.axisY.min, 0, "AxisY min"); | |||
|
38 | compare(lineSeries1.axisY.max, 10, "AxisY max"); | |||
|
39 | } | |||
|
40 | ||||
|
41 | function test_categories() { | |||
|
42 | compare(lineSeries1.axisY.startValue, 0, "AxisY start value"); | |||
|
43 | compare(lineSeries1.axisY.count, 3, "AxisY count"); | |||
|
44 | compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels"); | |||
|
45 | compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels"); | |||
|
46 | compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels"); | |||
|
47 | } | |||
|
48 | } | |||
|
49 | ||||
|
50 | ChartView { | |||
|
51 | id: chartView | |||
|
52 | anchors.fill: parent | |||
|
53 | ||||
|
54 | LineSeries { | |||
|
55 | id: lineSeries1 | |||
|
56 | axisX: ValuesAxis { | |||
|
57 | id: axisX | |||
|
58 | min: 0 | |||
|
59 | max: 10 | |||
|
60 | } | |||
|
61 | axisY: CategoryAxis { | |||
|
62 | id: axisY | |||
|
63 | min: 0 | |||
|
64 | max: 10 | |||
|
65 | startValue: 0 | |||
|
66 | CategoryRange { | |||
|
67 | label: "label0" | |||
|
68 | endValue: 1 | |||
|
69 | } | |||
|
70 | CategoryRange { | |||
|
71 | label: "label1" | |||
|
72 | endValue: 3 | |||
|
73 | } | |||
|
74 | CategoryRange { | |||
|
75 | label: "label2" | |||
|
76 | endValue: 10 | |||
|
77 | } | |||
|
78 | } | |||
|
79 | XYPoint { x: -1; y: -1 } | |||
|
80 | XYPoint { x: 0; y: 0 } | |||
|
81 | XYPoint { x: 5; y: 5 } | |||
|
82 | } | |||
|
83 | } | |||
|
84 | } |
@@ -0,0 +1,80 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest ChartView Properties 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_chartViewProperties() { | |||
|
35 | compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions"); | |||
|
36 | verify(chartView.backgroundColor != undefined); | |||
|
37 | verify(chartView.margins.bottom > 0, "ChartView.margins.bottom"); | |||
|
38 | verify(chartView.margins.top > 0, "ChartView.margins.top"); | |||
|
39 | verify(chartView.margins.left > 0, "ChartView.margins.left"); | |||
|
40 | verify(chartView.margins.right > 0, "ChartView.margins.right"); | |||
|
41 | compare(chartView.count, 0, "ChartView.count"); | |||
|
42 | compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled"); | |||
|
43 | verify(chartView.plotArea.height > 0, "ChartView.plotArea.height"); | |||
|
44 | verify(chartView.plotArea.width > 0, "ChartView.plotArea.width"); | |||
|
45 | verify(chartView.plotArea.x > 0, "ChartView.plotArea.x"); | |||
|
46 | verify(chartView.plotArea.y > 0, "ChartView.plotArea.y"); | |||
|
47 | compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme"); | |||
|
48 | compare(chartView.title, "", "ChartView.title"); | |||
|
49 | compare(chartView.title, "", "ChartView.title"); | |||
|
50 | verify(chartView.titleColor != undefined, "ChartView.titleColor"); | |||
|
51 | compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold"); | |||
|
52 | // Legend | |||
|
53 | compare(chartView.legend.visible, true, "ChartView.legend.visible"); | |||
|
54 | compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment"); | |||
|
55 | compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible"); | |||
|
56 | verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor"); | |||
|
57 | verify(chartView.legend.color != undefined, "ChartView.legend.color"); | |||
|
58 | compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers"); | |||
|
59 | // Legend font | |||
|
60 | compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold"); | |||
|
61 | compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization"); | |||
|
62 | verify(chartView.legend.font.family != "", "ChartView.legend.font.family"); | |||
|
63 | compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic"); | |||
|
64 | compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing"); | |||
|
65 | verify(chartView.legend.font.pixelSize > 0 | |||
|
66 | && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize"); | |||
|
67 | verify(chartView.legend.font.pointSize > 0 | |||
|
68 | && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize"); | |||
|
69 | compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout"); | |||
|
70 | compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline"); | |||
|
71 | compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight"); | |||
|
72 | compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing"); | |||
|
73 | } | |||
|
74 | } | |||
|
75 | ||||
|
76 | ChartView { | |||
|
77 | id: chartView | |||
|
78 | anchors.fill: parent | |||
|
79 | } | |||
|
80 | } |
@@ -0,0 +1,160 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest ChartView Functions 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_chartViewSeriesAndAxes() { | |||
|
35 | // Create XY series | |||
|
36 | var line = chartView.createSeries(ChartView.SeriesTypeLine, "line"); | |||
|
37 | verify(line != null && line != undefined); | |||
|
38 | var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline"); | |||
|
39 | verify(spline != null && spline != undefined); | |||
|
40 | var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter"); | |||
|
41 | verify(scatter != null && scatter != undefined); | |||
|
42 | ||||
|
43 | // Create a series with specific axes | |||
|
44 | var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line)); | |||
|
45 | ||||
|
46 | // Check that all the XY series use the same axes | |||
|
47 | verify(chartView.axisX(line) != null); | |||
|
48 | verify(chartView.axisY(line) != null); | |||
|
49 | compare(chartView.axisX(line), chartView.axisX(line2)); | |||
|
50 | compare(chartView.axisY(line), chartView.axisY(line2)); | |||
|
51 | compare(chartView.axisX(line), chartView.axisX(spline)); | |||
|
52 | compare(chartView.axisY(line), chartView.axisY(spline)); | |||
|
53 | compare(chartView.axisX(line), chartView.axisX(scatter)); | |||
|
54 | compare(chartView.axisY(line), chartView.axisY(scatter)); | |||
|
55 | ||||
|
56 | var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar"); | |||
|
57 | verify(bar != null && bar != undefined); | |||
|
58 | var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar"); | |||
|
59 | verify(stackedbar != null && stackedbar != undefined); | |||
|
60 | var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar"); | |||
|
61 | verify(percentbar != null && percentbar != undefined); | |||
|
62 | var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar"); | |||
|
63 | verify(horizontalbar != null && horizontalbar != undefined); | |||
|
64 | var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar"); | |||
|
65 | verify(horizontalstackedbar != null && horizontalstackedbar != undefined); | |||
|
66 | var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar"); | |||
|
67 | verify(horizontalpercentbar != null && horizontalpercentbar != undefined); | |||
|
68 | var area = chartView.createSeries(ChartView.SeriesTypeArea, "area"); | |||
|
69 | verify(area != null && area != undefined); | |||
|
70 | ||||
|
71 | // Remove all series | |||
|
72 | chartView.removeAllSeries(); | |||
|
73 | compare(chartView.count, 0); | |||
|
74 | } | |||
|
75 | ||||
|
76 | function test_chartViewRange() { | |||
|
77 | // Set initial values | |||
|
78 | chartView.createSeries(ChartView.SeriesTypeLine, "line"); | |||
|
79 | verify(chartView.axisX() != null); | |||
|
80 | verify(chartView.axisY() != null); | |||
|
81 | chartView.axisX().min = 1.0; | |||
|
82 | chartView.axisX().max = 2.0; | |||
|
83 | chartView.axisY().min = 1.0; | |||
|
84 | chartView.axisY().max = 2.0; | |||
|
85 | ||||
|
86 | var xMax = chartView.axisX().max; | |||
|
87 | var xMin = chartView.axisX().min; | |||
|
88 | var yMax = chartView.axisY().max; | |||
|
89 | var yMin = chartView.axisY().min; | |||
|
90 | ||||
|
91 | // zoom x 2.5 | |||
|
92 | chartView.zoom(1.5); | |||
|
93 | verify(chartView.axisX().max < xMax); | |||
|
94 | verify(chartView.axisX().min > xMin); | |||
|
95 | verify(chartView.axisY().max < yMax); | |||
|
96 | verify(chartView.axisY().min > yMin); | |||
|
97 | xMax = chartView.axisX().max; | |||
|
98 | xMin = chartView.axisX().min; | |||
|
99 | yMax = chartView.axisY().max; | |||
|
100 | yMin = chartView.axisY().min; | |||
|
101 | ||||
|
102 | // zoom x 0.5 | |||
|
103 | chartView.zoom(0.5); | |||
|
104 | verify(chartView.axisX().max > xMax); | |||
|
105 | verify(chartView.axisX().min < xMin); | |||
|
106 | verify(chartView.axisY().max > yMax); | |||
|
107 | verify(chartView.axisY().min < yMin); | |||
|
108 | xMax = chartView.axisX().max; | |||
|
109 | xMin = chartView.axisX().min; | |||
|
110 | yMax = chartView.axisY().max; | |||
|
111 | yMin = chartView.axisY().min; | |||
|
112 | ||||
|
113 | // Scroll up | |||
|
114 | chartView.scrollUp(10); | |||
|
115 | compare(chartView.axisX().max, xMax); | |||
|
116 | compare(chartView.axisX().min, xMin); | |||
|
117 | verify(chartView.axisY().max > yMax); | |||
|
118 | verify(chartView.axisY().min > yMin); | |||
|
119 | xMax = chartView.axisX().max; | |||
|
120 | xMin = chartView.axisX().min; | |||
|
121 | yMax = chartView.axisY().max; | |||
|
122 | yMin = chartView.axisY().min; | |||
|
123 | ||||
|
124 | // Scroll down | |||
|
125 | chartView.scrollDown(10); | |||
|
126 | compare(chartView.axisX().max, xMax); | |||
|
127 | compare(chartView.axisX().min, xMin); | |||
|
128 | verify(chartView.axisY().max < yMax); | |||
|
129 | verify(chartView.axisY().min < yMin); | |||
|
130 | xMax = chartView.axisX().max; | |||
|
131 | xMin = chartView.axisX().min; | |||
|
132 | yMax = chartView.axisY().max; | |||
|
133 | yMin = chartView.axisY().min; | |||
|
134 | ||||
|
135 | // Scroll left | |||
|
136 | chartView.scrollLeft(10); | |||
|
137 | verify(chartView.axisX().max < xMax); | |||
|
138 | verify(chartView.axisX().min < xMin); | |||
|
139 | compare(chartView.axisY().max, yMax); | |||
|
140 | compare(chartView.axisY().min, yMin); | |||
|
141 | xMax = chartView.axisX().max; | |||
|
142 | xMin = chartView.axisX().min; | |||
|
143 | yMax = chartView.axisY().max; | |||
|
144 | yMin = chartView.axisY().min; | |||
|
145 | ||||
|
146 | // Scroll right | |||
|
147 | chartView.scrollRight(10); | |||
|
148 | verify(chartView.axisX().max > xMax); | |||
|
149 | verify(chartView.axisX().min > xMin); | |||
|
150 | compare(chartView.axisY().max, yMax); | |||
|
151 | compare(chartView.axisY().min, yMin); | |||
|
152 | } | |||
|
153 | } | |||
|
154 | ||||
|
155 | ChartView { | |||
|
156 | id: chartView | |||
|
157 | anchors.fill: parent | |||
|
158 | title: "Chart" | |||
|
159 | } | |||
|
160 | } |
@@ -0,0 +1,73 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest ChartView Signals 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | // Verify onSeriesAdded and onSeriesRemoved signals | |||
|
35 | function test_chartView() { | |||
|
36 | var series = chartView.createSeries(ChartView.SeriesTypeLine, "line"); | |||
|
37 | seriesAddedSpy.wait(); | |||
|
38 | compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded"); | |||
|
39 | ||||
|
40 | // Modifying layout triggers more than one plotAreaChanged signal | |||
|
41 | chartView.titleFont.pixelSize = 50; | |||
|
42 | verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged"); | |||
|
43 | ||||
|
44 | chartView.removeSeries(series); | |||
|
45 | seriesRemovedSpy.wait(); | |||
|
46 | compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded"); | |||
|
47 | } | |||
|
48 | } | |||
|
49 | ||||
|
50 | ChartView { | |||
|
51 | id: chartView | |||
|
52 | anchors.fill: parent | |||
|
53 | title: "Chart" | |||
|
54 | ||||
|
55 | SignalSpy { | |||
|
56 | id: plotAreaChangedSpy | |||
|
57 | target: chartView | |||
|
58 | signalName: "plotAreaChanged" | |||
|
59 | } | |||
|
60 | ||||
|
61 | SignalSpy { | |||
|
62 | id: seriesAddedSpy | |||
|
63 | target: chartView | |||
|
64 | signalName: "seriesAdded" | |||
|
65 | } | |||
|
66 | ||||
|
67 | SignalSpy { | |||
|
68 | id: seriesRemovedSpy | |||
|
69 | target: chartView | |||
|
70 | signalName: "seriesRemoved" | |||
|
71 | } | |||
|
72 | } | |||
|
73 | } |
@@ -0,0 +1,131 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest PieSeries 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_properties() { | |||
|
35 | compare(pieSeries.endAngle, 360); | |||
|
36 | compare(pieSeries.holeSize, 0); | |||
|
37 | compare(pieSeries.horizontalPosition, 0.5); | |||
|
38 | compare(pieSeries.size, 0.7); | |||
|
39 | compare(pieSeries.startAngle, 0); | |||
|
40 | compare(pieSeries.sum, 0); | |||
|
41 | compare(pieSeries.verticalPosition, 0.5); | |||
|
42 | } | |||
|
43 | ||||
|
44 | function test_sliceproperties() { | |||
|
45 | var slice = pieSeries.append("slice", 10); | |||
|
46 | compare(slice.angleSpan, 360.0); | |||
|
47 | verify(slice.borderColor != undefined); | |||
|
48 | compare(slice.borderWidth, 1); | |||
|
49 | verify(slice.color != undefined); | |||
|
50 | compare(slice.explodeDistanceFactor, 0.15); | |||
|
51 | compare(slice.exploded, false); | |||
|
52 | compare(slice.label, "slice"); | |||
|
53 | compare(slice.labelArmLengthFactor, 0.15); | |||
|
54 | verify(slice.labelColor != undefined); | |||
|
55 | compare(slice.labelFont.bold, false); | |||
|
56 | compare(slice.labelPosition, PieSlice.LabelOutside); | |||
|
57 | compare(slice.labelVisible, false); | |||
|
58 | compare(slice.percentage, 1.0); | |||
|
59 | compare(slice.startAngle, 0.0); | |||
|
60 | compare(slice.value, 10.0); | |||
|
61 | } | |||
|
62 | ||||
|
63 | function test_append() { | |||
|
64 | addedSpy.clear(); | |||
|
65 | countChangedSpy.clear(); | |||
|
66 | sumChangedSpy.clear(); | |||
|
67 | var count = 50; | |||
|
68 | for (var i = 0; i < count; i++) | |||
|
69 | pieSeries.append("slice" + i, Math.random()); | |||
|
70 | compare(addedSpy.count, count); | |||
|
71 | compare(countChangedSpy.count, count); | |||
|
72 | compare(sumChangedSpy.count, count); | |||
|
73 | pieSeries.clear(); | |||
|
74 | } | |||
|
75 | ||||
|
76 | function test_remove() { | |||
|
77 | removedSpy.clear(); | |||
|
78 | countChangedSpy.clear(); | |||
|
79 | sumChangedSpy.clear(); | |||
|
80 | var count = 50; | |||
|
81 | for (var i = 0; i < count; i++) | |||
|
82 | pieSeries.append("slice" + i, Math.random()); | |||
|
83 | for (var j = 0; j < count; j++) | |||
|
84 | pieSeries.remove(pieSeries.at(0)); | |||
|
85 | compare(removedSpy.count, count); | |||
|
86 | compare(countChangedSpy.count, 2 * count); | |||
|
87 | compare(sumChangedSpy.count, 2 * count); | |||
|
88 | compare(pieSeries.count, 0); | |||
|
89 | } | |||
|
90 | ||||
|
91 | function test_find() { | |||
|
92 | var count = 50; | |||
|
93 | for (var i = 0; i < count; i++) | |||
|
94 | pieSeries.append("slice" + i, Math.random()); | |||
|
95 | for (var j = 0; j < count; j++) | |||
|
96 | compare(pieSeries.find("slice" + j).label, "slice" + j); | |||
|
97 | pieSeries.clear(); | |||
|
98 | } | |||
|
99 | } | |||
|
100 | ||||
|
101 | ChartView { | |||
|
102 | id: chartView | |||
|
103 | anchors.fill: parent | |||
|
104 | ||||
|
105 | PieSeries { | |||
|
106 | id: pieSeries | |||
|
107 | name: "pie" | |||
|
108 | ||||
|
109 | SignalSpy { | |||
|
110 | id: addedSpy | |||
|
111 | target: pieSeries | |||
|
112 | signalName: "added" | |||
|
113 | } | |||
|
114 | SignalSpy { | |||
|
115 | id: removedSpy | |||
|
116 | target: pieSeries | |||
|
117 | signalName: "removed" | |||
|
118 | } | |||
|
119 | SignalSpy { | |||
|
120 | id: sumChangedSpy | |||
|
121 | target: pieSeries | |||
|
122 | signalName: "sumChanged" | |||
|
123 | } | |||
|
124 | SignalSpy { | |||
|
125 | id: countChangedSpy | |||
|
126 | target: pieSeries | |||
|
127 | signalName: "countChanged" | |||
|
128 | } | |||
|
129 | } | |||
|
130 | } | |||
|
131 | } |
@@ -0,0 +1,116 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest ValueAxis 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | // test functions are run in alphabetical order, the name has 'a' so that it | |||
|
35 | // will be the first function to execute. | |||
|
36 | function test_a_properties() { | |||
|
37 | // Default properties | |||
|
38 | verify(axisX.min < 0, "AxisX min"); | |||
|
39 | verify(axisX.max > 0, "AxisX max"); | |||
|
40 | verify(axisY.min < 0, "AxisY min"); | |||
|
41 | verify(axisY.max > 0, "AxisY max"); | |||
|
42 | verify(axisX.tickCount == 5, "AxisX tick count"); | |||
|
43 | verify(axisY.tickCount == 5, "AxisY tick count"); | |||
|
44 | verify(axisX.labelFormat == "", "label format"); | |||
|
45 | ||||
|
46 | // Modify properties | |||
|
47 | axisX.tickCount = 3; | |||
|
48 | verify(axisX.tickCount == 3, "set tick count"); | |||
|
49 | } | |||
|
50 | ||||
|
51 | function test_functions() { | |||
|
52 | // Set the axis ranges to not "nice" ones... | |||
|
53 | var min = 0.032456456; | |||
|
54 | var max = 10.67845634; | |||
|
55 | axisX.min = min; | |||
|
56 | axisX.max = max; | |||
|
57 | axisY.min = min; | |||
|
58 | axisY.max = max; | |||
|
59 | ||||
|
60 | // ...And then apply nice numbers and verify the range was changed | |||
|
61 | axisX.applyNiceNumbers(); | |||
|
62 | axisY.applyNiceNumbers(); | |||
|
63 | verify(axisX.min != min); | |||
|
64 | verify(axisX.max != max); | |||
|
65 | verify(axisY.min != min); | |||
|
66 | verify(axisY.max != max); | |||
|
67 | } | |||
|
68 | ||||
|
69 | function test_signals() { | |||
|
70 | minChangedSpy.clear(); | |||
|
71 | maxChangedSpy.clear(); | |||
|
72 | axisX.min = 2; | |||
|
73 | compare(minChangedSpy.count, 1, "onMinChanged"); | |||
|
74 | compare(maxChangedSpy.count, 0, "onMaxChanged"); | |||
|
75 | ||||
|
76 | axisX.max = 8; | |||
|
77 | compare(minChangedSpy.count, 1, "onMinChanged"); | |||
|
78 | compare(maxChangedSpy.count, 1, "onMaxChanged"); | |||
|
79 | ||||
|
80 | // restore original values | |||
|
81 | axisX.min = 0; | |||
|
82 | axisX.max = 10; | |||
|
83 | compare(minChangedSpy.count, 2, "onMinChanged"); | |||
|
84 | compare(maxChangedSpy.count, 2, "onMaxChanged"); | |||
|
85 | } | |||
|
86 | } | |||
|
87 | ||||
|
88 | ChartView { | |||
|
89 | id: chartView | |||
|
90 | anchors.fill: parent | |||
|
91 | ||||
|
92 | LineSeries { | |||
|
93 | id: lineSeries1 | |||
|
94 | axisX: ValueAxis { | |||
|
95 | id: axisX | |||
|
96 | } | |||
|
97 | axisY: ValueAxis { | |||
|
98 | id: axisY | |||
|
99 | } | |||
|
100 | XYPoint { x: -1; y: -1 } | |||
|
101 | XYPoint { x: 0; y: 0 } | |||
|
102 | XYPoint { x: 5; y: 5 } | |||
|
103 | } | |||
|
104 | ||||
|
105 | SignalSpy { | |||
|
106 | id: minChangedSpy | |||
|
107 | target: axisX | |||
|
108 | signalName: "minChanged" | |||
|
109 | } | |||
|
110 | SignalSpy { | |||
|
111 | id: maxChangedSpy | |||
|
112 | target: axisX | |||
|
113 | signalName: "maxChanged" | |||
|
114 | } | |||
|
115 | } | |||
|
116 | } |
@@ -0,0 +1,260 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2013 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |||
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | import QtQuick 2.0 | |||
|
22 | import QtTest 1.0 | |||
|
23 | import QtCommercial.Chart 1.3 | |||
|
24 | ||||
|
25 | Rectangle { | |||
|
26 | width: 400 | |||
|
27 | height: 300 | |||
|
28 | ||||
|
29 | TestCase { | |||
|
30 | id: tc1 | |||
|
31 | name: "tst_qml-qtquicktest XY Series 1.3" | |||
|
32 | when: windowShown | |||
|
33 | ||||
|
34 | function test_properties() { | |||
|
35 | verify(lineSeries.color != undefined); | |||
|
36 | compare(lineSeries.pointsVisible, false); | |||
|
37 | compare(lineSeries.capStyle, Qt.SquareCap); | |||
|
38 | compare(lineSeries.style, Qt.SolidLine); | |||
|
39 | compare(lineSeries.width, 2.0); | |||
|
40 | ||||
|
41 | verify(splineSeries.color != undefined); | |||
|
42 | compare(splineSeries.pointsVisible, false); | |||
|
43 | compare(splineSeries.capStyle, Qt.SquareCap); | |||
|
44 | compare(splineSeries.style, Qt.SolidLine); | |||
|
45 | compare(splineSeries.width, 2.0); | |||
|
46 | ||||
|
47 | verify(scatterSeries.color != undefined); | |||
|
48 | verify(scatterSeries.borderColor != undefined); | |||
|
49 | compare(scatterSeries.borderWidth, 2.0); | |||
|
50 | compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle); | |||
|
51 | compare(scatterSeries.markerSize, 15.0); | |||
|
52 | ||||
|
53 | verify(areaSeries.color != undefined); | |||
|
54 | verify(areaSeries.borderColor != undefined); | |||
|
55 | compare(areaSeries.borderWidth, 2.0); | |||
|
56 | } | |||
|
57 | ||||
|
58 | function test_axes() { | |||
|
59 | // Axis initialization | |||
|
60 | compare(chartView.axisX(), lineSeries.axisX); | |||
|
61 | compare(chartView.axisY(), lineSeries.axisY); | |||
|
62 | compare(lineSeries.axisX, splineSeries.axisX); | |||
|
63 | compare(lineSeries.axisY, splineSeries.axisY); | |||
|
64 | compare(lineSeries.axisX, areaSeries.axisX); | |||
|
65 | compare(lineSeries.axisY, areaSeries.axisY); | |||
|
66 | } | |||
|
67 | ||||
|
68 | function test_append() { | |||
|
69 | lineSeriesPointAddedSpy.clear(); | |||
|
70 | splineSeriesPointAddedSpy.clear(); | |||
|
71 | scatterSeriesPointAddedSpy.clear(); | |||
|
72 | var count = append(); | |||
|
73 | compare(lineSeries.count, count); | |||
|
74 | compare(splineSeries.count, count); | |||
|
75 | compare(scatterSeries.count, count); | |||
|
76 | compare(lineSeriesPointAddedSpy.count, count); | |||
|
77 | compare(splineSeriesPointAddedSpy.count, count); | |||
|
78 | compare(scatterSeriesPointAddedSpy.count, count); | |||
|
79 | clear(); | |||
|
80 | compare(lineSeries.count, 0); | |||
|
81 | compare(splineSeries.count, 0); | |||
|
82 | compare(scatterSeries.count, 0); | |||
|
83 | } | |||
|
84 | ||||
|
85 | function test_replace() { | |||
|
86 | var count = append(); | |||
|
87 | for (var i = 0; i < count; i++) { | |||
|
88 | lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random()); | |||
|
89 | splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random()); | |||
|
90 | scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random()); | |||
|
91 | } | |||
|
92 | compare(lineSeries.count, count); | |||
|
93 | compare(splineSeries.count, count); | |||
|
94 | compare(scatterSeries.count, count); | |||
|
95 | compare(lineSeriesPointReplacedSpy.count, count); | |||
|
96 | compare(splineSeriesPointReplacedSpy.count, count); | |||
|
97 | compare(scatterSeriesPointReplacedSpy.count, count); | |||
|
98 | clear(); | |||
|
99 | } | |||
|
100 | ||||
|
101 | function test_insert() { | |||
|
102 | var count = append(); | |||
|
103 | lineSeriesPointAddedSpy.clear(); | |||
|
104 | splineSeriesPointAddedSpy.clear(); | |||
|
105 | scatterSeriesPointAddedSpy.clear(); | |||
|
106 | for (var i = 0; i < count; i++) { | |||
|
107 | lineSeries.insert(i * 2, i, Math.random()); | |||
|
108 | splineSeries.insert(i * 2, i, Math.random()); | |||
|
109 | scatterSeries.insert(i * 2, i, Math.random()); | |||
|
110 | } | |||
|
111 | compare(lineSeries.count, count * 2); | |||
|
112 | compare(splineSeries.count, count * 2); | |||
|
113 | compare(scatterSeries.count, count * 2); | |||
|
114 | compare(lineSeriesPointAddedSpy.count, count); | |||
|
115 | compare(splineSeriesPointAddedSpy.count, count); | |||
|
116 | compare(scatterSeriesPointAddedSpy.count, count); | |||
|
117 | clear(); | |||
|
118 | } | |||
|
119 | ||||
|
120 | function test_remove() { | |||
|
121 | lineSeriesPointRemovedSpy.clear(); | |||
|
122 | splineSeriesPointRemovedSpy.clear(); | |||
|
123 | scatterSeriesPointRemovedSpy.clear(); | |||
|
124 | var count = append(); | |||
|
125 | for (var i = 0; i < count; i++) { | |||
|
126 | lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y); | |||
|
127 | splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y); | |||
|
128 | scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y); | |||
|
129 | } | |||
|
130 | compare(lineSeries.count, 0); | |||
|
131 | compare(splineSeries.count, 0); | |||
|
132 | compare(scatterSeries.count, 0); | |||
|
133 | compare(lineSeriesPointRemovedSpy.count, count); | |||
|
134 | compare(splineSeriesPointRemovedSpy.count, count); | |||
|
135 | compare(scatterSeriesPointRemovedSpy.count, count); | |||
|
136 | } | |||
|
137 | ||||
|
138 | // Not a test function, called from test functions | |||
|
139 | function append() { | |||
|
140 | var count = 100; | |||
|
141 | chartView.axisX().min = 0; | |||
|
142 | chartView.axisX().max = 100; | |||
|
143 | chartView.axisY().min = 0; | |||
|
144 | chartView.axisY().max = 1; | |||
|
145 | ||||
|
146 | for (var i = 0; i < count; i++) { | |||
|
147 | lineSeries.append(i, Math.random()); | |||
|
148 | splineSeries.append(i, Math.random()); | |||
|
149 | scatterSeries.append(i, Math.random()); | |||
|
150 | } | |||
|
151 | ||||
|
152 | return count; | |||
|
153 | } | |||
|
154 | ||||
|
155 | // Not a test function, called from test functions | |||
|
156 | function clear() { | |||
|
157 | lineSeries.clear(); | |||
|
158 | splineSeries.clear(); | |||
|
159 | scatterSeries.clear(); | |||
|
160 | } | |||
|
161 | } | |||
|
162 | ||||
|
163 | ChartView { | |||
|
164 | id: chartView | |||
|
165 | anchors.fill: parent | |||
|
166 | ||||
|
167 | LineSeries { | |||
|
168 | id: lineSeries | |||
|
169 | name: "line" | |||
|
170 | ||||
|
171 | SignalSpy { | |||
|
172 | id: lineSeriesPointAddedSpy | |||
|
173 | target: lineSeries | |||
|
174 | signalName: "pointAdded" | |||
|
175 | } | |||
|
176 | ||||
|
177 | SignalSpy { | |||
|
178 | id: lineSeriesPointReplacedSpy | |||
|
179 | target: lineSeries | |||
|
180 | signalName: "pointReplaced" | |||
|
181 | } | |||
|
182 | ||||
|
183 | SignalSpy { | |||
|
184 | id: lineSeriesPointsReplacedSpy | |||
|
185 | target: lineSeries | |||
|
186 | signalName: "pointsReplaced" | |||
|
187 | } | |||
|
188 | ||||
|
189 | SignalSpy { | |||
|
190 | id: lineSeriesPointRemovedSpy | |||
|
191 | target: lineSeries | |||
|
192 | signalName: "pointRemoved" | |||
|
193 | } | |||
|
194 | } | |||
|
195 | ||||
|
196 | AreaSeries { | |||
|
197 | id: areaSeries | |||
|
198 | name: "area" | |||
|
199 | upperSeries: lineSeries | |||
|
200 | } | |||
|
201 | ||||
|
202 | SplineSeries { | |||
|
203 | id: splineSeries | |||
|
204 | name: "spline" | |||
|
205 | ||||
|
206 | SignalSpy { | |||
|
207 | id: splineSeriesPointAddedSpy | |||
|
208 | target: splineSeries | |||
|
209 | signalName: "pointAdded" | |||
|
210 | } | |||
|
211 | ||||
|
212 | SignalSpy { | |||
|
213 | id: splineSeriesPointReplacedSpy | |||
|
214 | target: splineSeries | |||
|
215 | signalName: "pointReplaced" | |||
|
216 | } | |||
|
217 | ||||
|
218 | SignalSpy { | |||
|
219 | id: splineSeriesPointsReplacedSpy | |||
|
220 | target: splineSeries | |||
|
221 | signalName: "pointsReplaced" | |||
|
222 | } | |||
|
223 | ||||
|
224 | SignalSpy { | |||
|
225 | id: splineSeriesPointRemovedSpy | |||
|
226 | target: splineSeries | |||
|
227 | signalName: "pointRemoved" | |||
|
228 | } | |||
|
229 | } | |||
|
230 | ||||
|
231 | ScatterSeries { | |||
|
232 | id: scatterSeries | |||
|
233 | name: "scatter" | |||
|
234 | ||||
|
235 | SignalSpy { | |||
|
236 | id: scatterSeriesPointAddedSpy | |||
|
237 | target: scatterSeries | |||
|
238 | signalName: "pointAdded" | |||
|
239 | } | |||
|
240 | ||||
|
241 | SignalSpy { | |||
|
242 | id: scatterSeriesPointReplacedSpy | |||
|
243 | target: scatterSeries | |||
|
244 | signalName: "pointReplaced" | |||
|
245 | } | |||
|
246 | ||||
|
247 | SignalSpy { | |||
|
248 | id: scatterSeriesPointsReplacedSpy | |||
|
249 | target: scatterSeries | |||
|
250 | signalName: "pointsReplaced" | |||
|
251 | } | |||
|
252 | ||||
|
253 | SignalSpy { | |||
|
254 | id: scatterSeriesPointRemovedSpy | |||
|
255 | target: scatterSeries | |||
|
256 | signalName: "pointRemoved" | |||
|
257 | } | |||
|
258 | } | |||
|
259 | } | |||
|
260 | } |
@@ -1,75 +1,115 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "declarativeareaseries.h" |
|
21 | #include "declarativeareaseries.h" | |
22 | #include "declarativelineseries.h" |
|
22 | #include "declarativelineseries.h" | |
23 |
|
23 | |||
24 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
24 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
25 |
|
25 | |||
26 | DeclarativeAreaSeries::DeclarativeAreaSeries(QObject *parent) : |
|
26 | DeclarativeAreaSeries::DeclarativeAreaSeries(QObject *parent) : | |
27 | QAreaSeries(parent), |
|
27 | QAreaSeries(parent), | |
28 | m_axes(new DeclarativeAxes(this)) |
|
28 | m_axes(new DeclarativeAxes(this)) | |
29 | { |
|
29 | { | |
30 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
30 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
31 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
31 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
32 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
32 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
33 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
33 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
34 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisAngularChanged(QAbstractAxis*))); |
|
34 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisAngularChanged(QAbstractAxis*))); | |
35 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisRadialChanged(QAbstractAxis*))); |
|
35 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisRadialChanged(QAbstractAxis*))); | |
|
36 | connect(this, SIGNAL(brushChanged()), this, SLOT(handleBrushChanged())); | |||
36 | } |
|
37 | } | |
37 |
|
38 | |||
38 | void DeclarativeAreaSeries::setUpperSeries(DeclarativeLineSeries *series) |
|
39 | void DeclarativeAreaSeries::setUpperSeries(DeclarativeLineSeries *series) | |
39 | { |
|
40 | { | |
40 | QAreaSeries::setUpperSeries(series); |
|
41 | QAreaSeries::setUpperSeries(series); | |
41 | } |
|
42 | } | |
42 |
|
43 | |||
43 | DeclarativeLineSeries *DeclarativeAreaSeries::upperSeries() const |
|
44 | DeclarativeLineSeries *DeclarativeAreaSeries::upperSeries() const | |
44 | { |
|
45 | { | |
45 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::upperSeries()); |
|
46 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::upperSeries()); | |
46 | } |
|
47 | } | |
47 |
|
48 | |||
48 | void DeclarativeAreaSeries::setLowerSeries(DeclarativeLineSeries *series) |
|
49 | void DeclarativeAreaSeries::setLowerSeries(DeclarativeLineSeries *series) | |
49 | { |
|
50 | { | |
50 | QAreaSeries::setLowerSeries(series); |
|
51 | QAreaSeries::setLowerSeries(series); | |
51 | } |
|
52 | } | |
52 |
|
53 | |||
53 | DeclarativeLineSeries *DeclarativeAreaSeries::lowerSeries() const |
|
54 | DeclarativeLineSeries *DeclarativeAreaSeries::lowerSeries() const | |
54 | { |
|
55 | { | |
55 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::lowerSeries()); |
|
56 | return qobject_cast<DeclarativeLineSeries *>(QAreaSeries::lowerSeries()); | |
56 | } |
|
57 | } | |
57 |
|
58 | |||
58 | qreal DeclarativeAreaSeries::borderWidth() const |
|
59 | qreal DeclarativeAreaSeries::borderWidth() const | |
59 | { |
|
60 | { | |
60 | return pen().widthF(); |
|
61 | return pen().widthF(); | |
61 | } |
|
62 | } | |
62 |
|
63 | |||
63 | void DeclarativeAreaSeries::setBorderWidth(qreal width) |
|
64 | void DeclarativeAreaSeries::setBorderWidth(qreal width) | |
64 | { |
|
65 | { | |
65 | if (width != pen().widthF()) { |
|
66 | if (width != pen().widthF()) { | |
66 | QPen p = pen(); |
|
67 | QPen p = pen(); | |
67 | p.setWidthF(width); |
|
68 | p.setWidthF(width); | |
68 | setPen(p); |
|
69 | setPen(p); | |
69 | emit borderWidthChanged(width); |
|
70 | emit borderWidthChanged(width); | |
70 | } |
|
71 | } | |
71 | } |
|
72 | } | |
72 |
|
73 | |||
|
74 | QString DeclarativeAreaSeries::brushFilename() const | |||
|
75 | { | |||
|
76 | return m_brushFilename; | |||
|
77 | } | |||
|
78 | ||||
|
79 | void DeclarativeAreaSeries::setBrushFilename(const QString &brushFilename) | |||
|
80 | { | |||
|
81 | QImage brushImage(brushFilename); | |||
|
82 | if (QAreaSeries::brush().textureImage() != brushImage) { | |||
|
83 | QBrush brush = QAreaSeries::brush(); | |||
|
84 | brush.setTextureImage(brushImage); | |||
|
85 | QAreaSeries::setBrush(brush); | |||
|
86 | m_brushFilename = brushFilename; | |||
|
87 | m_brushImage = brushImage; | |||
|
88 | emit brushFilenameChanged(brushFilename); | |||
|
89 | } | |||
|
90 | } | |||
|
91 | ||||
|
92 | void DeclarativeAreaSeries::handleBrushChanged() | |||
|
93 | { | |||
|
94 | // If the texture image of the brush has changed along the brush | |||
|
95 | // the brush file name needs to be cleared. | |||
|
96 | if (!m_brushFilename.isEmpty() && QAreaSeries::brush().textureImage() != m_brushImage) { | |||
|
97 | m_brushFilename.clear(); | |||
|
98 | emit brushFilenameChanged(QString("")); | |||
|
99 | } | |||
|
100 | } | |||
|
101 | ||||
|
102 | void DeclarativeAreaSeries::setBrush(const QBrush &brush) | |||
|
103 | { | |||
|
104 | QAreaSeries::setBrush(brush); | |||
|
105 | emit brushChanged(); | |||
|
106 | } | |||
|
107 | ||||
|
108 | QBrush DeclarativeAreaSeries::brush() const | |||
|
109 | { | |||
|
110 | return QAreaSeries::brush(); | |||
|
111 | } | |||
|
112 | ||||
73 | #include "moc_declarativeareaseries.cpp" |
|
113 | #include "moc_declarativeareaseries.cpp" | |
74 |
|
114 | |||
75 | QTCOMMERCIALCHART_END_NAMESPACE |
|
115 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,79 +1,94 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEAREASERIES_H |
|
21 | #ifndef DECLARATIVEAREASERIES_H | |
22 | #define DECLARATIVEAREASERIES_H |
|
22 | #define DECLARATIVEAREASERIES_H | |
23 |
|
23 | |||
24 | #include "qareaseries.h" |
|
24 | #include "qareaseries.h" | |
25 | #include "declarativeaxes.h" |
|
25 | #include "declarativeaxes.h" | |
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 | class DeclarativeLineSeries; |
|
28 | class DeclarativeLineSeries; | |
29 |
|
29 | |||
30 | class DeclarativeAreaSeries : public QAreaSeries |
|
30 | class DeclarativeAreaSeries : public QAreaSeries | |
31 | { |
|
31 | { | |
32 | Q_OBJECT |
|
32 | Q_OBJECT | |
33 | Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries) |
|
33 | Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries) | |
34 | Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries) |
|
34 | Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries) | |
35 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
35 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
36 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
36 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
37 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
37 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
38 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
38 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
39 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) |
|
39 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) | |
40 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) |
|
40 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) | |
41 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
41 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
|
42 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 4) | |||
|
43 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION 4) | |||
42 |
|
44 | |||
43 | public: |
|
45 | public: | |
44 | explicit DeclarativeAreaSeries(QObject *parent = 0); |
|
46 | explicit DeclarativeAreaSeries(QObject *parent = 0); | |
45 | void setUpperSeries(DeclarativeLineSeries *series); |
|
47 | void setUpperSeries(DeclarativeLineSeries *series); | |
46 | DeclarativeLineSeries *upperSeries() const; |
|
48 | DeclarativeLineSeries *upperSeries() const; | |
47 | void setLowerSeries(DeclarativeLineSeries *series); |
|
49 | void setLowerSeries(DeclarativeLineSeries *series); | |
48 | DeclarativeLineSeries *lowerSeries() const; |
|
50 | DeclarativeLineSeries *lowerSeries() const; | |
49 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
51 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
50 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
52 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
51 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
53 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
52 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
54 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
53 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
55 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
54 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
56 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
55 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
57 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
56 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
58 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
57 | Q_REVISION(3) QAbstractAxis *axisAngular() { return m_axes->axisX(); } |
|
59 | Q_REVISION(3) QAbstractAxis *axisAngular() { return m_axes->axisX(); } | |
58 | Q_REVISION(3) void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
60 | Q_REVISION(3) void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
59 | Q_REVISION(3) QAbstractAxis *axisRadial() { return m_axes->axisY(); } |
|
61 | Q_REVISION(3) QAbstractAxis *axisRadial() { return m_axes->axisY(); } | |
60 | Q_REVISION(3) void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
62 | Q_REVISION(3) void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
61 | qreal borderWidth() const; |
|
63 | qreal borderWidth() const; | |
62 | void setBorderWidth(qreal borderWidth); |
|
64 | void setBorderWidth(qreal borderWidth); | |
|
65 | QString brushFilename() const; | |||
|
66 | void setBrushFilename(const QString &brushFilename); | |||
|
67 | void setBrush(const QBrush &brush); | |||
|
68 | QBrush brush() const; | |||
63 |
|
69 | |||
64 | Q_SIGNALS: |
|
70 | Q_SIGNALS: | |
65 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
71 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
66 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
72 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
67 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
73 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
68 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
74 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
69 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
75 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
70 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); |
|
76 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); | |
71 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); |
|
77 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); | |
|
78 | Q_REVISION(4) void brushChanged(); | |||
|
79 | Q_REVISION(4) void brushFilenameChanged(const QString &brushFilename); | |||
|
80 | ||||
|
81 | private Q_SLOTS: | |||
|
82 | void handleBrushChanged(); | |||
72 |
|
83 | |||
73 | public: |
|
84 | public: | |
74 | DeclarativeAxes *m_axes; |
|
85 | DeclarativeAxes *m_axes; | |
|
86 | ||||
|
87 | private: | |||
|
88 | QString m_brushFilename; | |||
|
89 | QImage m_brushImage; | |||
75 | }; |
|
90 | }; | |
76 |
|
91 | |||
77 | QTCOMMERCIALCHART_END_NAMESPACE |
|
92 | QTCOMMERCIALCHART_END_NAMESPACE | |
78 |
|
93 | |||
79 | #endif // DECLARATIVEAREASERIES_H |
|
94 | #endif // DECLARATIVEAREASERIES_H |
@@ -1,480 +1,509 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "declarativebarseries.h" |
|
21 | #include "declarativebarseries.h" | |
22 | #include "qbarset.h" |
|
22 | #include "qbarset.h" | |
23 | #include "qvbarmodelmapper.h" |
|
23 | #include "qvbarmodelmapper.h" | |
24 | #include "qhbarmodelmapper.h" |
|
24 | #include "qhbarmodelmapper.h" | |
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
27 |
|
27 | |||
28 | DeclarativeBarSet::DeclarativeBarSet(QObject *parent) |
|
28 | DeclarativeBarSet::DeclarativeBarSet(QObject *parent) | |
29 | : QBarSet("", parent) |
|
29 | : QBarSet("", parent) | |
30 | { |
|
30 | { | |
31 | connect(this, SIGNAL(valuesAdded(int,int)), this, SLOT(handleCountChanged(int,int))); |
|
31 | connect(this, SIGNAL(valuesAdded(int,int)), this, SLOT(handleCountChanged(int,int))); | |
32 | connect(this, SIGNAL(valuesRemoved(int,int)), this, SLOT(handleCountChanged(int,int))); |
|
32 | connect(this, SIGNAL(valuesRemoved(int,int)), this, SLOT(handleCountChanged(int,int))); | |
|
33 | connect(this, SIGNAL(brushChanged()), this, SLOT(handleBrushChanged())); | |||
33 | } |
|
34 | } | |
34 |
|
35 | |||
35 | void DeclarativeBarSet::handleCountChanged(int index, int count) |
|
36 | void DeclarativeBarSet::handleCountChanged(int index, int count) | |
36 | { |
|
37 | { | |
37 | Q_UNUSED(index) |
|
38 | Q_UNUSED(index) | |
38 | Q_UNUSED(count) |
|
39 | Q_UNUSED(count) | |
39 | emit countChanged(QBarSet::count()); |
|
40 | emit countChanged(QBarSet::count()); | |
40 | } |
|
41 | } | |
41 |
|
42 | |||
42 | qreal DeclarativeBarSet::borderWidth() const |
|
43 | qreal DeclarativeBarSet::borderWidth() const | |
43 | { |
|
44 | { | |
44 | return pen().widthF(); |
|
45 | return pen().widthF(); | |
45 | } |
|
46 | } | |
46 |
|
47 | |||
47 | void DeclarativeBarSet::setBorderWidth(qreal width) |
|
48 | void DeclarativeBarSet::setBorderWidth(qreal width) | |
48 | { |
|
49 | { | |
49 | if (width != pen().widthF()) { |
|
50 | if (width != pen().widthF()) { | |
50 | QPen p = pen(); |
|
51 | QPen p = pen(); | |
51 | p.setWidthF(width); |
|
52 | p.setWidthF(width); | |
52 | setPen(p); |
|
53 | setPen(p); | |
53 | emit borderWidthChanged(width); |
|
54 | emit borderWidthChanged(width); | |
54 | } |
|
55 | } | |
55 | } |
|
56 | } | |
56 |
|
57 | |||
57 | QVariantList DeclarativeBarSet::values() |
|
58 | QVariantList DeclarativeBarSet::values() | |
58 | { |
|
59 | { | |
59 | QVariantList values; |
|
60 | QVariantList values; | |
60 | for (int i(0); i < count(); i++) |
|
61 | for (int i(0); i < count(); i++) | |
61 | values.append(QVariant(QBarSet::at(i))); |
|
62 | values.append(QVariant(QBarSet::at(i))); | |
62 | return values; |
|
63 | return values; | |
63 | } |
|
64 | } | |
64 |
|
65 | |||
65 | void DeclarativeBarSet::setValues(QVariantList values) |
|
66 | void DeclarativeBarSet::setValues(QVariantList values) | |
66 | { |
|
67 | { | |
67 | while (count()) |
|
68 | while (count()) | |
68 | remove(count() - 1); |
|
69 | remove(count() - 1); | |
69 |
|
70 | |||
70 | if (values.at(0).canConvert(QVariant::Point)) { |
|
71 | if (values.at(0).canConvert(QVariant::Point)) { | |
71 | // Create list of values for appending if the first item is Qt.point |
|
72 | // Create list of values for appending if the first item is Qt.point | |
72 | int maxValue = 0; |
|
73 | int maxValue = 0; | |
73 | for (int i = 0; i < values.count(); i++) { |
|
74 | for (int i = 0; i < values.count(); i++) { | |
74 | if (values.at(i).canConvert(QVariant::Point) && |
|
75 | if (values.at(i).canConvert(QVariant::Point) && | |
75 | values.at(i).toPoint().x() > maxValue) { |
|
76 | values.at(i).toPoint().x() > maxValue) { | |
76 | maxValue = values.at(i).toPoint().x(); |
|
77 | maxValue = values.at(i).toPoint().x(); | |
77 | } |
|
78 | } | |
78 | } |
|
79 | } | |
79 |
|
80 | |||
80 | QVector<int> indexValueList; |
|
81 | QVector<int> indexValueList; | |
81 | indexValueList.resize(maxValue + 1); |
|
82 | indexValueList.resize(maxValue + 1); | |
82 |
|
83 | |||
83 | for (int i = 0; i < values.count(); i++) { |
|
84 | for (int i = 0; i < values.count(); i++) { | |
84 | if (values.at(i).canConvert(QVariant::Point)) { |
|
85 | if (values.at(i).canConvert(QVariant::Point)) { | |
85 | indexValueList.replace(values.at(i).toPoint().x(), values.at(i).toPoint().y()); |
|
86 | indexValueList.replace(values.at(i).toPoint().x(), values.at(i).toPoint().y()); | |
86 | } |
|
87 | } | |
87 | } |
|
88 | } | |
88 |
|
89 | |||
89 | for (int i = 0; i < indexValueList.count(); i++) |
|
90 | for (int i = 0; i < indexValueList.count(); i++) | |
90 | QBarSet::append(indexValueList.at(i)); |
|
91 | QBarSet::append(indexValueList.at(i)); | |
91 |
|
92 | |||
92 | } else { |
|
93 | } else { | |
93 | for (int i(0); i < values.count(); i++) { |
|
94 | for (int i(0); i < values.count(); i++) { | |
94 | if (values.at(i).canConvert(QVariant::Double)) |
|
95 | if (values.at(i).canConvert(QVariant::Double)) | |
95 | QBarSet::append(values[i].toDouble()); |
|
96 | QBarSet::append(values[i].toDouble()); | |
96 | } |
|
97 | } | |
97 | } |
|
98 | } | |
98 | } |
|
99 | } | |
99 |
|
100 | |||
|
101 | QString DeclarativeBarSet::brushFilename() const | |||
|
102 | { | |||
|
103 | return m_brushFilename; | |||
|
104 | } | |||
|
105 | ||||
|
106 | void DeclarativeBarSet::setBrushFilename(const QString &brushFilename) | |||
|
107 | { | |||
|
108 | QImage brushImage(brushFilename); | |||
|
109 | if (QBarSet::brush().textureImage() != brushImage) { | |||
|
110 | QBrush brush = QBarSet::brush(); | |||
|
111 | brush.setTextureImage(brushImage); | |||
|
112 | QBarSet::setBrush(brush); | |||
|
113 | m_brushFilename = brushFilename; | |||
|
114 | m_brushImage = brushImage; | |||
|
115 | emit brushFilenameChanged(brushFilename); | |||
|
116 | } | |||
|
117 | } | |||
|
118 | ||||
|
119 | void DeclarativeBarSet::handleBrushChanged() | |||
|
120 | { | |||
|
121 | // If the texture image of the brush has changed along the brush | |||
|
122 | // the brush file name needs to be cleared. | |||
|
123 | if (!m_brushFilename.isEmpty() && QBarSet::brush().textureImage() != m_brushImage) { | |||
|
124 | m_brushFilename.clear(); | |||
|
125 | emit brushFilenameChanged(QString("")); | |||
|
126 | } | |||
|
127 | } | |||
|
128 | ||||
100 | // Declarative bar series ====================================================================================== |
|
129 | // Declarative bar series ====================================================================================== | |
101 | DeclarativeBarSeries::DeclarativeBarSeries(QDECLARATIVE_ITEM *parent) : |
|
130 | DeclarativeBarSeries::DeclarativeBarSeries(QDECLARATIVE_ITEM *parent) : | |
102 | QBarSeries(parent), |
|
131 | QBarSeries(parent), | |
103 | m_axes(new DeclarativeAxes(this)) |
|
132 | m_axes(new DeclarativeAxes(this)) | |
104 | { |
|
133 | { | |
105 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
134 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
106 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
135 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
107 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
136 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
108 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
137 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
109 | } |
|
138 | } | |
110 |
|
139 | |||
111 | void DeclarativeBarSeries::classBegin() |
|
140 | void DeclarativeBarSeries::classBegin() | |
112 | { |
|
141 | { | |
113 | } |
|
142 | } | |
114 |
|
143 | |||
115 | void DeclarativeBarSeries::componentComplete() |
|
144 | void DeclarativeBarSeries::componentComplete() | |
116 | { |
|
145 | { | |
117 | foreach (QObject *child, children()) { |
|
146 | foreach (QObject *child, children()) { | |
118 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
147 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
119 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
148 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
120 | } else if (qobject_cast<QVBarModelMapper *>(child)) { |
|
149 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
121 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
150 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
122 | mapper->setSeries(this); |
|
151 | mapper->setSeries(this); | |
123 | } else if (qobject_cast<QHBarModelMapper *>(child)) { |
|
152 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
124 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
153 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
125 | mapper->setSeries(this); |
|
154 | mapper->setSeries(this); | |
126 | } |
|
155 | } | |
127 | } |
|
156 | } | |
128 | } |
|
157 | } | |
129 |
|
158 | |||
130 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeBarSeries::seriesChildren() |
|
159 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeBarSeries::seriesChildren() | |
131 | { |
|
160 | { | |
132 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
161 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
133 | } |
|
162 | } | |
134 |
|
163 | |||
135 | void DeclarativeBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) |
|
164 | void DeclarativeBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) | |
136 | { |
|
165 | { | |
137 | // Empty implementation; the children are parsed in componentComplete instead |
|
166 | // Empty implementation; the children are parsed in componentComplete instead | |
138 | Q_UNUSED(list); |
|
167 | Q_UNUSED(list); | |
139 | Q_UNUSED(element); |
|
168 | Q_UNUSED(element); | |
140 | } |
|
169 | } | |
141 |
|
170 | |||
142 | DeclarativeBarSet *DeclarativeBarSeries::at(int index) |
|
171 | DeclarativeBarSet *DeclarativeBarSeries::at(int index) | |
143 | { |
|
172 | { | |
144 | QList<QBarSet *> setList = barSets(); |
|
173 | QList<QBarSet *> setList = barSets(); | |
145 | if (index >= 0 && index < setList.count()) |
|
174 | if (index >= 0 && index < setList.count()) | |
146 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
175 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
147 |
|
176 | |||
148 | return 0; |
|
177 | return 0; | |
149 | } |
|
178 | } | |
150 |
|
179 | |||
151 | DeclarativeBarSet *DeclarativeBarSeries::insert(int index, QString label, QVariantList values) |
|
180 | DeclarativeBarSet *DeclarativeBarSeries::insert(int index, QString label, QVariantList values) | |
152 | { |
|
181 | { | |
153 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); |
|
182 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); | |
154 | barset->setLabel(label); |
|
183 | barset->setLabel(label); | |
155 | barset->setValues(values); |
|
184 | barset->setValues(values); | |
156 | if (QBarSeries::insert(index, barset)) |
|
185 | if (QBarSeries::insert(index, barset)) | |
157 | return barset; |
|
186 | return barset; | |
158 | delete barset; |
|
187 | delete barset; | |
159 | return 0; |
|
188 | return 0; | |
160 | } |
|
189 | } | |
161 |
|
190 | |||
162 | // Declarative stacked bar series ============================================================================== |
|
191 | // Declarative stacked bar series ============================================================================== | |
163 | DeclarativeStackedBarSeries::DeclarativeStackedBarSeries(QDECLARATIVE_ITEM *parent) : |
|
192 | DeclarativeStackedBarSeries::DeclarativeStackedBarSeries(QDECLARATIVE_ITEM *parent) : | |
164 | QStackedBarSeries(parent), |
|
193 | QStackedBarSeries(parent), | |
165 | m_axes(0) |
|
194 | m_axes(0) | |
166 | { |
|
195 | { | |
167 | m_axes = new DeclarativeAxes(this); |
|
196 | m_axes = new DeclarativeAxes(this); | |
168 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
197 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
169 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
198 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
170 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
199 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
171 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
200 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
172 | } |
|
201 | } | |
173 |
|
202 | |||
174 | void DeclarativeStackedBarSeries::classBegin() |
|
203 | void DeclarativeStackedBarSeries::classBegin() | |
175 | { |
|
204 | { | |
176 | } |
|
205 | } | |
177 |
|
206 | |||
178 | void DeclarativeStackedBarSeries::componentComplete() |
|
207 | void DeclarativeStackedBarSeries::componentComplete() | |
179 | { |
|
208 | { | |
180 | foreach (QObject *child, children()) { |
|
209 | foreach (QObject *child, children()) { | |
181 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
210 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
182 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
211 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
183 | } else if (qobject_cast<QVBarModelMapper *>(child)) { |
|
212 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
184 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
213 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
185 | mapper->setSeries(this); |
|
214 | mapper->setSeries(this); | |
186 | } else if (qobject_cast<QHBarModelMapper *>(child)) { |
|
215 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
187 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
216 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
188 | mapper->setSeries(this); |
|
217 | mapper->setSeries(this); | |
189 | } |
|
218 | } | |
190 | } |
|
219 | } | |
191 | } |
|
220 | } | |
192 |
|
221 | |||
193 |
|
222 | |||
194 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeStackedBarSeries::seriesChildren() |
|
223 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeStackedBarSeries::seriesChildren() | |
195 | { |
|
224 | { | |
196 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
225 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
197 | } |
|
226 | } | |
198 |
|
227 | |||
199 | void DeclarativeStackedBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) |
|
228 | void DeclarativeStackedBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) | |
200 | { |
|
229 | { | |
201 | // Empty implementation; the children are parsed in componentComplete instead |
|
230 | // Empty implementation; the children are parsed in componentComplete instead | |
202 | Q_UNUSED(list); |
|
231 | Q_UNUSED(list); | |
203 | Q_UNUSED(element); |
|
232 | Q_UNUSED(element); | |
204 | } |
|
233 | } | |
205 |
|
234 | |||
206 | DeclarativeBarSet *DeclarativeStackedBarSeries::at(int index) |
|
235 | DeclarativeBarSet *DeclarativeStackedBarSeries::at(int index) | |
207 | { |
|
236 | { | |
208 | QList<QBarSet *> setList = barSets(); |
|
237 | QList<QBarSet *> setList = barSets(); | |
209 | if (index >= 0 && index < setList.count()) |
|
238 | if (index >= 0 && index < setList.count()) | |
210 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
239 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
211 |
|
240 | |||
212 | return 0; |
|
241 | return 0; | |
213 | } |
|
242 | } | |
214 |
|
243 | |||
215 | DeclarativeBarSet *DeclarativeStackedBarSeries::insert(int index, QString label, QVariantList values) |
|
244 | DeclarativeBarSet *DeclarativeStackedBarSeries::insert(int index, QString label, QVariantList values) | |
216 | { |
|
245 | { | |
217 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); |
|
246 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); | |
218 | barset->setLabel(label); |
|
247 | barset->setLabel(label); | |
219 | barset->setValues(values); |
|
248 | barset->setValues(values); | |
220 | if (QStackedBarSeries::insert(index, barset)) |
|
249 | if (QStackedBarSeries::insert(index, barset)) | |
221 | return barset; |
|
250 | return barset; | |
222 | delete barset; |
|
251 | delete barset; | |
223 | return 0; |
|
252 | return 0; | |
224 | } |
|
253 | } | |
225 |
|
254 | |||
226 | // Declarative percent bar series ============================================================================== |
|
255 | // Declarative percent bar series ============================================================================== | |
227 | DeclarativePercentBarSeries::DeclarativePercentBarSeries(QDECLARATIVE_ITEM *parent) : |
|
256 | DeclarativePercentBarSeries::DeclarativePercentBarSeries(QDECLARATIVE_ITEM *parent) : | |
228 | QPercentBarSeries(parent), |
|
257 | QPercentBarSeries(parent), | |
229 | m_axes(0) |
|
258 | m_axes(0) | |
230 | { |
|
259 | { | |
231 | m_axes = new DeclarativeAxes(this); |
|
260 | m_axes = new DeclarativeAxes(this); | |
232 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
261 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
233 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
262 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
234 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
263 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
235 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
264 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
236 | } |
|
265 | } | |
237 |
|
266 | |||
238 | void DeclarativePercentBarSeries::classBegin() |
|
267 | void DeclarativePercentBarSeries::classBegin() | |
239 | { |
|
268 | { | |
240 | } |
|
269 | } | |
241 |
|
270 | |||
242 | void DeclarativePercentBarSeries::componentComplete() |
|
271 | void DeclarativePercentBarSeries::componentComplete() | |
243 | { |
|
272 | { | |
244 | foreach (QObject *child, children()) { |
|
273 | foreach (QObject *child, children()) { | |
245 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
274 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
246 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
275 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
247 | } else if (qobject_cast<QVBarModelMapper *>(child)) { |
|
276 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
248 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
277 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
249 | mapper->setSeries(this); |
|
278 | mapper->setSeries(this); | |
250 | } else if (qobject_cast<QHBarModelMapper *>(child)) { |
|
279 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
251 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
280 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
252 | mapper->setSeries(this); |
|
281 | mapper->setSeries(this); | |
253 | } |
|
282 | } | |
254 | } |
|
283 | } | |
255 | } |
|
284 | } | |
256 |
|
285 | |||
257 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativePercentBarSeries::seriesChildren() |
|
286 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativePercentBarSeries::seriesChildren() | |
258 | { |
|
287 | { | |
259 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
288 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
260 | } |
|
289 | } | |
261 |
|
290 | |||
262 | void DeclarativePercentBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) |
|
291 | void DeclarativePercentBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) | |
263 | { |
|
292 | { | |
264 | // Empty implementation; the children are parsed in componentComplete instead |
|
293 | // Empty implementation; the children are parsed in componentComplete instead | |
265 | Q_UNUSED(list); |
|
294 | Q_UNUSED(list); | |
266 | Q_UNUSED(element); |
|
295 | Q_UNUSED(element); | |
267 | } |
|
296 | } | |
268 |
|
297 | |||
269 | DeclarativeBarSet *DeclarativePercentBarSeries::at(int index) |
|
298 | DeclarativeBarSet *DeclarativePercentBarSeries::at(int index) | |
270 | { |
|
299 | { | |
271 | QList<QBarSet *> setList = barSets(); |
|
300 | QList<QBarSet *> setList = barSets(); | |
272 | if (index >= 0 && index < setList.count()) |
|
301 | if (index >= 0 && index < setList.count()) | |
273 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
302 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
274 |
|
303 | |||
275 | return 0; |
|
304 | return 0; | |
276 | } |
|
305 | } | |
277 |
|
306 | |||
278 | DeclarativeBarSet *DeclarativePercentBarSeries::insert(int index, QString label, QVariantList values) |
|
307 | DeclarativeBarSet *DeclarativePercentBarSeries::insert(int index, QString label, QVariantList values) | |
279 | { |
|
308 | { | |
280 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); |
|
309 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); | |
281 | barset->setLabel(label); |
|
310 | barset->setLabel(label); | |
282 | barset->setValues(values); |
|
311 | barset->setValues(values); | |
283 | if (QPercentBarSeries::insert(index, barset)) |
|
312 | if (QPercentBarSeries::insert(index, barset)) | |
284 | return barset; |
|
313 | return barset; | |
285 | delete barset; |
|
314 | delete barset; | |
286 | return 0; |
|
315 | return 0; | |
287 | } |
|
316 | } | |
288 |
|
317 | |||
289 | // Declarative horizontal bar series =========================================================================== |
|
318 | // Declarative horizontal bar series =========================================================================== | |
290 | DeclarativeHorizontalBarSeries::DeclarativeHorizontalBarSeries(QDECLARATIVE_ITEM *parent) : |
|
319 | DeclarativeHorizontalBarSeries::DeclarativeHorizontalBarSeries(QDECLARATIVE_ITEM *parent) : | |
291 | QHorizontalBarSeries(parent), |
|
320 | QHorizontalBarSeries(parent), | |
292 | m_axes(0) |
|
321 | m_axes(0) | |
293 | { |
|
322 | { | |
294 | m_axes = new DeclarativeAxes(this); |
|
323 | m_axes = new DeclarativeAxes(this); | |
295 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
324 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
296 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
325 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
297 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
326 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
298 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
327 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
299 | } |
|
328 | } | |
300 |
|
329 | |||
301 | void DeclarativeHorizontalBarSeries::classBegin() |
|
330 | void DeclarativeHorizontalBarSeries::classBegin() | |
302 | { |
|
331 | { | |
303 | } |
|
332 | } | |
304 |
|
333 | |||
305 | void DeclarativeHorizontalBarSeries::componentComplete() |
|
334 | void DeclarativeHorizontalBarSeries::componentComplete() | |
306 | { |
|
335 | { | |
307 | foreach (QObject *child, children()) { |
|
336 | foreach (QObject *child, children()) { | |
308 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
337 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
309 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
338 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
310 | } else if (qobject_cast<QVBarModelMapper *>(child)) { |
|
339 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
311 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
340 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
312 | mapper->setSeries(this); |
|
341 | mapper->setSeries(this); | |
313 | } else if (qobject_cast<QHBarModelMapper *>(child)) { |
|
342 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
314 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
343 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
315 | mapper->setSeries(this); |
|
344 | mapper->setSeries(this); | |
316 | } |
|
345 | } | |
317 | } |
|
346 | } | |
318 | } |
|
347 | } | |
319 |
|
348 | |||
320 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeHorizontalBarSeries::seriesChildren() |
|
349 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeHorizontalBarSeries::seriesChildren() | |
321 | { |
|
350 | { | |
322 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeHorizontalBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
351 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeHorizontalBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
323 | } |
|
352 | } | |
324 |
|
353 | |||
325 | void DeclarativeHorizontalBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) |
|
354 | void DeclarativeHorizontalBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) | |
326 | { |
|
355 | { | |
327 | // Empty implementation; the children are parsed in componentComplete instead |
|
356 | // Empty implementation; the children are parsed in componentComplete instead | |
328 | Q_UNUSED(list); |
|
357 | Q_UNUSED(list); | |
329 | Q_UNUSED(element); |
|
358 | Q_UNUSED(element); | |
330 | } |
|
359 | } | |
331 |
|
360 | |||
332 | DeclarativeBarSet *DeclarativeHorizontalBarSeries::at(int index) |
|
361 | DeclarativeBarSet *DeclarativeHorizontalBarSeries::at(int index) | |
333 | { |
|
362 | { | |
334 | QList<QBarSet *> setList = barSets(); |
|
363 | QList<QBarSet *> setList = barSets(); | |
335 | if (index >= 0 && index < setList.count()) |
|
364 | if (index >= 0 && index < setList.count()) | |
336 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
365 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
337 |
|
366 | |||
338 | return 0; |
|
367 | return 0; | |
339 | } |
|
368 | } | |
340 |
|
369 | |||
341 | DeclarativeBarSet *DeclarativeHorizontalBarSeries::insert(int index, QString label, QVariantList values) |
|
370 | DeclarativeBarSet *DeclarativeHorizontalBarSeries::insert(int index, QString label, QVariantList values) | |
342 | { |
|
371 | { | |
343 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); |
|
372 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); | |
344 | barset->setLabel(label); |
|
373 | barset->setLabel(label); | |
345 | barset->setValues(values); |
|
374 | barset->setValues(values); | |
346 | if (QHorizontalBarSeries::insert(index, barset)) |
|
375 | if (QHorizontalBarSeries::insert(index, barset)) | |
347 | return barset; |
|
376 | return barset; | |
348 | delete barset; |
|
377 | delete barset; | |
349 | return 0; |
|
378 | return 0; | |
350 | } |
|
379 | } | |
351 |
|
380 | |||
352 | // Declarative horizontal stacked bar series =================================================================== |
|
381 | // Declarative horizontal stacked bar series =================================================================== | |
353 | DeclarativeHorizontalStackedBarSeries::DeclarativeHorizontalStackedBarSeries(QDECLARATIVE_ITEM *parent) : |
|
382 | DeclarativeHorizontalStackedBarSeries::DeclarativeHorizontalStackedBarSeries(QDECLARATIVE_ITEM *parent) : | |
354 | QHorizontalStackedBarSeries(parent), |
|
383 | QHorizontalStackedBarSeries(parent), | |
355 | m_axes(0) |
|
384 | m_axes(0) | |
356 | { |
|
385 | { | |
357 | m_axes = new DeclarativeAxes(this); |
|
386 | m_axes = new DeclarativeAxes(this); | |
358 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
387 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
359 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
388 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
360 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
389 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
361 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
390 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
362 | } |
|
391 | } | |
363 |
|
392 | |||
364 | void DeclarativeHorizontalStackedBarSeries::classBegin() |
|
393 | void DeclarativeHorizontalStackedBarSeries::classBegin() | |
365 | { |
|
394 | { | |
366 | } |
|
395 | } | |
367 |
|
396 | |||
368 | void DeclarativeHorizontalStackedBarSeries::componentComplete() |
|
397 | void DeclarativeHorizontalStackedBarSeries::componentComplete() | |
369 | { |
|
398 | { | |
370 | foreach (QObject *child, children()) { |
|
399 | foreach (QObject *child, children()) { | |
371 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
400 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
372 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
401 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
373 | } else if (qobject_cast<QVBarModelMapper *>(child)) { |
|
402 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
374 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
403 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
375 | mapper->setSeries(this); |
|
404 | mapper->setSeries(this); | |
376 | } else if (qobject_cast<QHBarModelMapper *>(child)) { |
|
405 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
377 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
406 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
378 | mapper->setSeries(this); |
|
407 | mapper->setSeries(this); | |
379 | } |
|
408 | } | |
380 | } |
|
409 | } | |
381 | } |
|
410 | } | |
382 |
|
411 | |||
383 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeHorizontalStackedBarSeries::seriesChildren() |
|
412 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeHorizontalStackedBarSeries::seriesChildren() | |
384 | { |
|
413 | { | |
385 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeHorizontalStackedBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
414 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeHorizontalStackedBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
386 | } |
|
415 | } | |
387 |
|
416 | |||
388 | void DeclarativeHorizontalStackedBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) |
|
417 | void DeclarativeHorizontalStackedBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) | |
389 | { |
|
418 | { | |
390 | // Empty implementation; the children are parsed in componentComplete instead |
|
419 | // Empty implementation; the children are parsed in componentComplete instead | |
391 | Q_UNUSED(list); |
|
420 | Q_UNUSED(list); | |
392 | Q_UNUSED(element); |
|
421 | Q_UNUSED(element); | |
393 | } |
|
422 | } | |
394 |
|
423 | |||
395 | DeclarativeBarSet *DeclarativeHorizontalStackedBarSeries::at(int index) |
|
424 | DeclarativeBarSet *DeclarativeHorizontalStackedBarSeries::at(int index) | |
396 | { |
|
425 | { | |
397 | QList<QBarSet *> setList = barSets(); |
|
426 | QList<QBarSet *> setList = barSets(); | |
398 | if (index >= 0 && index < setList.count()) |
|
427 | if (index >= 0 && index < setList.count()) | |
399 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
428 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
400 |
|
429 | |||
401 | return 0; |
|
430 | return 0; | |
402 | } |
|
431 | } | |
403 |
|
432 | |||
404 | DeclarativeBarSet *DeclarativeHorizontalStackedBarSeries::insert(int index, QString label, QVariantList values) |
|
433 | DeclarativeBarSet *DeclarativeHorizontalStackedBarSeries::insert(int index, QString label, QVariantList values) | |
405 | { |
|
434 | { | |
406 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); |
|
435 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); | |
407 | barset->setLabel(label); |
|
436 | barset->setLabel(label); | |
408 | barset->setValues(values); |
|
437 | barset->setValues(values); | |
409 | if (QHorizontalStackedBarSeries::insert(index, barset)) |
|
438 | if (QHorizontalStackedBarSeries::insert(index, barset)) | |
410 | return barset; |
|
439 | return barset; | |
411 | delete barset; |
|
440 | delete barset; | |
412 | return 0; |
|
441 | return 0; | |
413 | } |
|
442 | } | |
414 |
|
443 | |||
415 | // Declarative horizontal percent bar series =================================================================== |
|
444 | // Declarative horizontal percent bar series =================================================================== | |
416 | DeclarativeHorizontalPercentBarSeries::DeclarativeHorizontalPercentBarSeries(QDECLARATIVE_ITEM *parent) : |
|
445 | DeclarativeHorizontalPercentBarSeries::DeclarativeHorizontalPercentBarSeries(QDECLARATIVE_ITEM *parent) : | |
417 | QHorizontalPercentBarSeries(parent), |
|
446 | QHorizontalPercentBarSeries(parent), | |
418 | m_axes(0) |
|
447 | m_axes(0) | |
419 | { |
|
448 | { | |
420 | m_axes = new DeclarativeAxes(this); |
|
449 | m_axes = new DeclarativeAxes(this); | |
421 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
450 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
422 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
451 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
423 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
452 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
424 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
453 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
425 | } |
|
454 | } | |
426 |
|
455 | |||
427 | void DeclarativeHorizontalPercentBarSeries::classBegin() |
|
456 | void DeclarativeHorizontalPercentBarSeries::classBegin() | |
428 | { |
|
457 | { | |
429 | } |
|
458 | } | |
430 |
|
459 | |||
431 | void DeclarativeHorizontalPercentBarSeries::componentComplete() |
|
460 | void DeclarativeHorizontalPercentBarSeries::componentComplete() | |
432 | { |
|
461 | { | |
433 | foreach (QObject *child, children()) { |
|
462 | foreach (QObject *child, children()) { | |
434 | if (qobject_cast<DeclarativeBarSet *>(child)) { |
|
463 | if (qobject_cast<DeclarativeBarSet *>(child)) { | |
435 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); |
|
464 | QAbstractBarSeries::append(qobject_cast<DeclarativeBarSet *>(child)); | |
436 | } else if (qobject_cast<QVBarModelMapper *>(child)) { |
|
465 | } else if (qobject_cast<QVBarModelMapper *>(child)) { | |
437 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); |
|
466 | QVBarModelMapper *mapper = qobject_cast<QVBarModelMapper *>(child); | |
438 | mapper->setSeries(this); |
|
467 | mapper->setSeries(this); | |
439 | } else if (qobject_cast<QHBarModelMapper *>(child)) { |
|
468 | } else if (qobject_cast<QHBarModelMapper *>(child)) { | |
440 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); |
|
469 | QHBarModelMapper *mapper = qobject_cast<QHBarModelMapper *>(child); | |
441 | mapper->setSeries(this); |
|
470 | mapper->setSeries(this); | |
442 | } |
|
471 | } | |
443 | } |
|
472 | } | |
444 | } |
|
473 | } | |
445 |
|
474 | |||
446 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeHorizontalPercentBarSeries::seriesChildren() |
|
475 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeHorizontalPercentBarSeries::seriesChildren() | |
447 | { |
|
476 | { | |
448 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeHorizontalPercentBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
477 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeHorizontalPercentBarSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
449 | } |
|
478 | } | |
450 |
|
479 | |||
451 | void DeclarativeHorizontalPercentBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) |
|
480 | void DeclarativeHorizontalPercentBarSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) | |
452 | { |
|
481 | { | |
453 | // Empty implementation; the children are parsed in componentComplete instead |
|
482 | // Empty implementation; the children are parsed in componentComplete instead | |
454 | Q_UNUSED(list); |
|
483 | Q_UNUSED(list); | |
455 | Q_UNUSED(element); |
|
484 | Q_UNUSED(element); | |
456 | } |
|
485 | } | |
457 |
|
486 | |||
458 | DeclarativeBarSet *DeclarativeHorizontalPercentBarSeries::at(int index) |
|
487 | DeclarativeBarSet *DeclarativeHorizontalPercentBarSeries::at(int index) | |
459 | { |
|
488 | { | |
460 | QList<QBarSet *> setList = barSets(); |
|
489 | QList<QBarSet *> setList = barSets(); | |
461 | if (index >= 0 && index < setList.count()) |
|
490 | if (index >= 0 && index < setList.count()) | |
462 | return qobject_cast<DeclarativeBarSet *>(setList[index]); |
|
491 | return qobject_cast<DeclarativeBarSet *>(setList[index]); | |
463 |
|
492 | |||
464 | return 0; |
|
493 | return 0; | |
465 | } |
|
494 | } | |
466 |
|
495 | |||
467 | DeclarativeBarSet *DeclarativeHorizontalPercentBarSeries::insert(int index, QString label, QVariantList values) |
|
496 | DeclarativeBarSet *DeclarativeHorizontalPercentBarSeries::insert(int index, QString label, QVariantList values) | |
468 | { |
|
497 | { | |
469 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); |
|
498 | DeclarativeBarSet *barset = new DeclarativeBarSet(this); | |
470 | barset->setLabel(label); |
|
499 | barset->setLabel(label); | |
471 | barset->setValues(values); |
|
500 | barset->setValues(values); | |
472 | if (QHorizontalPercentBarSeries::insert(index, barset)) |
|
501 | if (QHorizontalPercentBarSeries::insert(index, barset)) | |
473 | return barset; |
|
502 | return barset; | |
474 | delete barset; |
|
503 | delete barset; | |
475 | return 0; |
|
504 | return 0; | |
476 | } |
|
505 | } | |
477 |
|
506 | |||
478 | #include "moc_declarativebarseries.cpp" |
|
507 | #include "moc_declarativebarseries.cpp" | |
479 |
|
508 | |||
480 | QTCOMMERCIALCHART_END_NAMESPACE |
|
509 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,406 +1,415 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEBARSERIES_H |
|
21 | #ifndef DECLARATIVEBARSERIES_H | |
22 | #define DECLARATIVEBARSERIES_H |
|
22 | #define DECLARATIVEBARSERIES_H | |
23 |
|
23 | |||
24 | #include "qbarseries.h" |
|
24 | #include "qbarseries.h" | |
25 | #include "qstackedbarseries.h" |
|
25 | #include "qstackedbarseries.h" | |
26 | #include "qpercentbarseries.h" |
|
26 | #include "qpercentbarseries.h" | |
27 | #include "qhorizontalbarseries.h" |
|
27 | #include "qhorizontalbarseries.h" | |
28 | #include "qhorizontalstackedbarseries.h" |
|
28 | #include "qhorizontalstackedbarseries.h" | |
29 | #include "qhorizontalpercentbarseries.h" |
|
29 | #include "qhorizontalpercentbarseries.h" | |
30 | #include "qbarset.h" |
|
30 | #include "qbarset.h" | |
31 | #include "declarativeaxes.h" |
|
31 | #include "declarativeaxes.h" | |
32 | #include "shared_defines.h" |
|
32 | #include "shared_defines.h" | |
33 |
|
33 | |||
34 | #ifdef CHARTS_FOR_QUICK2 |
|
34 | #ifdef CHARTS_FOR_QUICK2 | |
35 | #include <QtQuick/QQuickItem> |
|
35 | #include <QtQuick/QQuickItem> | |
36 | #include <QtQml/QQmlParserStatus> |
|
36 | #include <QtQml/QQmlParserStatus> | |
37 | #else |
|
37 | #else | |
38 | #include <QtDeclarative/QDeclarativeItem> |
|
38 | #include <QtDeclarative/QDeclarativeItem> | |
39 | #include <QtDeclarative/QDeclarativeParserStatus> |
|
39 | #include <QtDeclarative/QDeclarativeParserStatus> | |
40 | #endif |
|
40 | #endif | |
41 |
|
41 | |||
42 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
42 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
43 |
|
43 | |||
44 | class QChart; |
|
44 | class QChart; | |
45 |
|
45 | |||
46 | class DeclarativeBarSet : public QBarSet |
|
46 | class DeclarativeBarSet : public QBarSet | |
47 | { |
|
47 | { | |
48 | Q_OBJECT |
|
48 | Q_OBJECT | |
49 | Q_PROPERTY(QVariantList values READ values WRITE setValues) |
|
49 | Q_PROPERTY(QVariantList values READ values WRITE setValues) | |
50 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
50 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
51 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
51 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
|
52 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 2) | |||
52 |
|
53 | |||
53 | public: |
|
54 | public: | |
54 | explicit DeclarativeBarSet(QObject *parent = 0); |
|
55 | explicit DeclarativeBarSet(QObject *parent = 0); | |
55 | QVariantList values(); |
|
56 | QVariantList values(); | |
56 | void setValues(QVariantList values); |
|
57 | void setValues(QVariantList values); | |
57 | qreal borderWidth() const; |
|
58 | qreal borderWidth() const; | |
58 | void setBorderWidth(qreal borderWidth); |
|
59 | void setBorderWidth(qreal borderWidth); | |
|
60 | QString brushFilename() const; | |||
|
61 | void setBrushFilename(const QString &brushFilename); | |||
59 |
|
62 | |||
60 | public: // From QBarSet |
|
63 | public: // From QBarSet | |
61 | Q_INVOKABLE void append(qreal value) { QBarSet::append(value); } |
|
64 | Q_INVOKABLE void append(qreal value) { QBarSet::append(value); } | |
62 | Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); } |
|
65 | Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); } | |
63 | Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); } |
|
66 | Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); } | |
64 | Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); } |
|
67 | Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); } | |
65 |
|
68 | |||
66 | Q_SIGNALS: |
|
69 | Q_SIGNALS: | |
67 | void countChanged(int count); |
|
70 | void countChanged(int count); | |
68 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
71 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
|
72 | Q_REVISION(2) void brushFilenameChanged(const QString &brushFilename); | |||
69 |
|
73 | |||
70 | private Q_SLOTS: |
|
74 | private Q_SLOTS: | |
71 | void handleCountChanged(int index, int count); |
|
75 | void handleCountChanged(int index, int count); | |
|
76 | void handleBrushChanged(); | |||
|
77 | ||||
|
78 | private: | |||
|
79 | QString m_brushFilename; | |||
|
80 | QImage m_brushImage; | |||
72 | }; |
|
81 | }; | |
73 |
|
82 | |||
74 | class DeclarativeBarSeries : public QBarSeries, public QDECLARATIVE_PARSER_STATUS |
|
83 | class DeclarativeBarSeries : public QBarSeries, public QDECLARATIVE_PARSER_STATUS | |
75 | { |
|
84 | { | |
76 | Q_OBJECT |
|
85 | Q_OBJECT | |
77 | #ifdef CHARTS_FOR_QUICK2 |
|
86 | #ifdef CHARTS_FOR_QUICK2 | |
78 | Q_INTERFACES(QQmlParserStatus) |
|
87 | Q_INTERFACES(QQmlParserStatus) | |
79 | #else |
|
88 | #else | |
80 | Q_INTERFACES(QDeclarativeParserStatus) |
|
89 | Q_INTERFACES(QDeclarativeParserStatus) | |
81 | #endif |
|
90 | #endif | |
82 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
91 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
83 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
92 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
84 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
93 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
85 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
94 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
86 | #ifdef CHARTS_FOR_QUICK2 |
|
95 | #ifdef CHARTS_FOR_QUICK2 | |
87 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
96 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
88 | #else |
|
97 | #else | |
89 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
98 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
90 | #endif |
|
99 | #endif | |
91 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
100 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
92 |
|
101 | |||
93 | public: |
|
102 | public: | |
94 | explicit DeclarativeBarSeries(QDECLARATIVE_ITEM *parent = 0); |
|
103 | explicit DeclarativeBarSeries(QDECLARATIVE_ITEM *parent = 0); | |
95 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
104 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
96 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
105 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
97 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
106 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
98 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
107 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
99 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
108 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
100 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
109 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
101 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
110 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
102 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
111 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
103 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
112 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
104 |
|
113 | |||
105 | public: |
|
114 | public: | |
106 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
115 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
107 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
116 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
108 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
117 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
109 | Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); } |
|
118 | Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); } | |
110 | Q_INVOKABLE void clear() { return QBarSeries::clear(); } |
|
119 | Q_INVOKABLE void clear() { return QBarSeries::clear(); } | |
111 |
|
120 | |||
112 | public: // from QDeclarativeParserStatus |
|
121 | public: // from QDeclarativeParserStatus | |
113 | void classBegin(); |
|
122 | void classBegin(); | |
114 | void componentComplete(); |
|
123 | void componentComplete(); | |
115 |
|
124 | |||
116 | Q_SIGNALS: |
|
125 | Q_SIGNALS: | |
117 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
126 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
118 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
127 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
119 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
128 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
120 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
129 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
121 |
|
130 | |||
122 | public Q_SLOTS: |
|
131 | public Q_SLOTS: | |
123 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
132 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
124 |
|
133 | |||
125 | public: |
|
134 | public: | |
126 | DeclarativeAxes *m_axes; |
|
135 | DeclarativeAxes *m_axes; | |
127 | }; |
|
136 | }; | |
128 |
|
137 | |||
129 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDECLARATIVE_PARSER_STATUS |
|
138 | class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDECLARATIVE_PARSER_STATUS | |
130 | { |
|
139 | { | |
131 | Q_OBJECT |
|
140 | Q_OBJECT | |
132 | #ifdef CHARTS_FOR_QUICK2 |
|
141 | #ifdef CHARTS_FOR_QUICK2 | |
133 | Q_INTERFACES(QQmlParserStatus) |
|
142 | Q_INTERFACES(QQmlParserStatus) | |
134 | #else |
|
143 | #else | |
135 | Q_INTERFACES(QDeclarativeParserStatus) |
|
144 | Q_INTERFACES(QDeclarativeParserStatus) | |
136 | #endif |
|
145 | #endif | |
137 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
146 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
138 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
147 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
139 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
148 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
140 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
149 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
141 | #ifdef CHARTS_FOR_QUICK2 |
|
150 | #ifdef CHARTS_FOR_QUICK2 | |
142 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
151 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
143 | #else |
|
152 | #else | |
144 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
153 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
145 | #endif |
|
154 | #endif | |
146 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
155 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
147 |
|
156 | |||
148 | public: |
|
157 | public: | |
149 | explicit DeclarativeStackedBarSeries(QDECLARATIVE_ITEM *parent = 0); |
|
158 | explicit DeclarativeStackedBarSeries(QDECLARATIVE_ITEM *parent = 0); | |
150 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
159 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
151 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
160 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
152 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
161 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
153 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
162 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
154 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
163 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
155 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
164 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
156 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
165 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
157 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
166 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
158 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
167 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
159 |
|
168 | |||
160 | public: |
|
169 | public: | |
161 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
170 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
162 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
171 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
163 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
172 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
164 | Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); } |
|
173 | Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); } | |
165 | Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); } |
|
174 | Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); } | |
166 |
|
175 | |||
167 | public: // from QDeclarativeParserStatus |
|
176 | public: // from QDeclarativeParserStatus | |
168 | void classBegin(); |
|
177 | void classBegin(); | |
169 | void componentComplete(); |
|
178 | void componentComplete(); | |
170 |
|
179 | |||
171 | Q_SIGNALS: |
|
180 | Q_SIGNALS: | |
172 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
181 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
173 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
182 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
174 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
183 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
175 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
184 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
176 |
|
185 | |||
177 | public Q_SLOTS: |
|
186 | public Q_SLOTS: | |
178 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
187 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
179 |
|
188 | |||
180 | public: |
|
189 | public: | |
181 | DeclarativeAxes *m_axes; |
|
190 | DeclarativeAxes *m_axes; | |
182 | }; |
|
191 | }; | |
183 |
|
192 | |||
184 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QDECLARATIVE_PARSER_STATUS |
|
193 | class DeclarativePercentBarSeries : public QPercentBarSeries, public QDECLARATIVE_PARSER_STATUS | |
185 | { |
|
194 | { | |
186 | Q_OBJECT |
|
195 | Q_OBJECT | |
187 | #ifdef CHARTS_FOR_QUICK2 |
|
196 | #ifdef CHARTS_FOR_QUICK2 | |
188 | Q_INTERFACES(QQmlParserStatus) |
|
197 | Q_INTERFACES(QQmlParserStatus) | |
189 | #else |
|
198 | #else | |
190 | Q_INTERFACES(QDeclarativeParserStatus) |
|
199 | Q_INTERFACES(QDeclarativeParserStatus) | |
191 | #endif |
|
200 | #endif | |
192 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
201 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
193 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
202 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
194 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
203 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
195 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
204 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
196 | #ifdef CHARTS_FOR_QUICK2 |
|
205 | #ifdef CHARTS_FOR_QUICK2 | |
197 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
206 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
198 | #else |
|
207 | #else | |
199 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
208 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
200 | #endif |
|
209 | #endif | |
201 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
210 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
202 |
|
211 | |||
203 | public: |
|
212 | public: | |
204 | explicit DeclarativePercentBarSeries(QDECLARATIVE_ITEM *parent = 0); |
|
213 | explicit DeclarativePercentBarSeries(QDECLARATIVE_ITEM *parent = 0); | |
205 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
214 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
206 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
215 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
207 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
216 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
208 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
217 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
209 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
218 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
210 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
219 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
211 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
220 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
212 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
221 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
213 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
222 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
214 |
|
223 | |||
215 | public: |
|
224 | public: | |
216 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
225 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
217 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
226 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
218 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
227 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
219 | Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); } |
|
228 | Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); } | |
220 | Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); } |
|
229 | Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); } | |
221 |
|
230 | |||
222 | public: // from QDeclarativeParserStatus |
|
231 | public: // from QDeclarativeParserStatus | |
223 | void classBegin(); |
|
232 | void classBegin(); | |
224 | void componentComplete(); |
|
233 | void componentComplete(); | |
225 |
|
234 | |||
226 | Q_SIGNALS: |
|
235 | Q_SIGNALS: | |
227 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
236 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
228 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
237 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
229 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
238 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
230 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
239 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
231 |
|
240 | |||
232 | public Q_SLOTS: |
|
241 | public Q_SLOTS: | |
233 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
242 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
234 |
|
243 | |||
235 | public: |
|
244 | public: | |
236 | DeclarativeAxes *m_axes; |
|
245 | DeclarativeAxes *m_axes; | |
237 | }; |
|
246 | }; | |
238 |
|
247 | |||
239 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDECLARATIVE_PARSER_STATUS |
|
248 | class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDECLARATIVE_PARSER_STATUS | |
240 | { |
|
249 | { | |
241 | Q_OBJECT |
|
250 | Q_OBJECT | |
242 | #ifdef CHARTS_FOR_QUICK2 |
|
251 | #ifdef CHARTS_FOR_QUICK2 | |
243 | Q_INTERFACES(QQmlParserStatus) |
|
252 | Q_INTERFACES(QQmlParserStatus) | |
244 | #else |
|
253 | #else | |
245 | Q_INTERFACES(QDeclarativeParserStatus) |
|
254 | Q_INTERFACES(QDeclarativeParserStatus) | |
246 | #endif |
|
255 | #endif | |
247 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
256 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
248 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
257 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
249 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
258 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
250 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
259 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
251 | #ifdef CHARTS_FOR_QUICK2 |
|
260 | #ifdef CHARTS_FOR_QUICK2 | |
252 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
261 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
253 | #else |
|
262 | #else | |
254 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
263 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
255 | #endif |
|
264 | #endif | |
256 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
265 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
257 |
|
266 | |||
258 | public: |
|
267 | public: | |
259 | explicit DeclarativeHorizontalBarSeries(QDECLARATIVE_ITEM *parent = 0); |
|
268 | explicit DeclarativeHorizontalBarSeries(QDECLARATIVE_ITEM *parent = 0); | |
260 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
269 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
261 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
270 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
262 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
271 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
263 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
272 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
264 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
273 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
265 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
274 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
266 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
275 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
267 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
276 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
268 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
277 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
269 |
|
278 | |||
270 | public: |
|
279 | public: | |
271 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
280 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
272 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
281 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
273 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
282 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
274 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); } |
|
283 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); } | |
275 | Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); } |
|
284 | Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); } | |
276 |
|
285 | |||
277 | public: // from QDeclarativeParserStatus |
|
286 | public: // from QDeclarativeParserStatus | |
278 | void classBegin(); |
|
287 | void classBegin(); | |
279 | void componentComplete(); |
|
288 | void componentComplete(); | |
280 |
|
289 | |||
281 | Q_SIGNALS: |
|
290 | Q_SIGNALS: | |
282 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
291 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
283 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
292 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
284 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
293 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
285 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
294 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
286 |
|
295 | |||
287 | public Q_SLOTS: |
|
296 | public Q_SLOTS: | |
288 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
297 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
289 |
|
298 | |||
290 | public: |
|
299 | public: | |
291 | DeclarativeAxes *m_axes; |
|
300 | DeclarativeAxes *m_axes; | |
292 | }; |
|
301 | }; | |
293 |
|
302 | |||
294 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDECLARATIVE_PARSER_STATUS |
|
303 | class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDECLARATIVE_PARSER_STATUS | |
295 | { |
|
304 | { | |
296 | Q_OBJECT |
|
305 | Q_OBJECT | |
297 | #ifdef CHARTS_FOR_QUICK2 |
|
306 | #ifdef CHARTS_FOR_QUICK2 | |
298 | Q_INTERFACES(QQmlParserStatus) |
|
307 | Q_INTERFACES(QQmlParserStatus) | |
299 | #else |
|
308 | #else | |
300 | Q_INTERFACES(QDeclarativeParserStatus) |
|
309 | Q_INTERFACES(QDeclarativeParserStatus) | |
301 | #endif |
|
310 | #endif | |
302 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
311 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
303 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
312 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
304 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
313 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
305 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
314 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
306 | #ifdef CHARTS_FOR_QUICK2 |
|
315 | #ifdef CHARTS_FOR_QUICK2 | |
307 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
316 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
308 | #else |
|
317 | #else | |
309 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
318 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
310 | #endif |
|
319 | #endif | |
311 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
320 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
312 |
|
321 | |||
313 | public: |
|
322 | public: | |
314 | explicit DeclarativeHorizontalStackedBarSeries(QDECLARATIVE_ITEM *parent = 0); |
|
323 | explicit DeclarativeHorizontalStackedBarSeries(QDECLARATIVE_ITEM *parent = 0); | |
315 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
324 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
316 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
325 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
317 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
326 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
318 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
327 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
319 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
328 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
320 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
329 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
321 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
330 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
322 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
331 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
323 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
332 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
324 |
|
333 | |||
325 | public: |
|
334 | public: | |
326 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
335 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
327 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
336 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
328 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
337 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
329 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); } |
|
338 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); } | |
330 | Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); } |
|
339 | Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); } | |
331 |
|
340 | |||
332 | public: // from QDeclarativeParserStatus |
|
341 | public: // from QDeclarativeParserStatus | |
333 | void classBegin(); |
|
342 | void classBegin(); | |
334 | void componentComplete(); |
|
343 | void componentComplete(); | |
335 |
|
344 | |||
336 | Q_SIGNALS: |
|
345 | Q_SIGNALS: | |
337 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
346 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
338 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
347 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
339 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
348 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
340 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
349 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
341 |
|
350 | |||
342 | public Q_SLOTS: |
|
351 | public Q_SLOTS: | |
343 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
352 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
344 |
|
353 | |||
345 | public: |
|
354 | public: | |
346 | DeclarativeAxes *m_axes; |
|
355 | DeclarativeAxes *m_axes; | |
347 | }; |
|
356 | }; | |
348 |
|
357 | |||
349 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDECLARATIVE_PARSER_STATUS |
|
358 | class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDECLARATIVE_PARSER_STATUS | |
350 | { |
|
359 | { | |
351 | Q_OBJECT |
|
360 | Q_OBJECT | |
352 | #ifdef CHARTS_FOR_QUICK2 |
|
361 | #ifdef CHARTS_FOR_QUICK2 | |
353 | Q_INTERFACES(QQmlParserStatus) |
|
362 | Q_INTERFACES(QQmlParserStatus) | |
354 | #else |
|
363 | #else | |
355 | Q_INTERFACES(QDeclarativeParserStatus) |
|
364 | Q_INTERFACES(QDeclarativeParserStatus) | |
356 | #endif |
|
365 | #endif | |
357 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
366 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
358 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
367 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
359 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
368 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
360 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
369 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
361 | #ifdef CHARTS_FOR_QUICK2 |
|
370 | #ifdef CHARTS_FOR_QUICK2 | |
362 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
371 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
363 | #else |
|
372 | #else | |
364 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
373 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
365 | #endif |
|
374 | #endif | |
366 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
375 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
367 |
|
376 | |||
368 | public: |
|
377 | public: | |
369 | explicit DeclarativeHorizontalPercentBarSeries(QDECLARATIVE_ITEM *parent = 0); |
|
378 | explicit DeclarativeHorizontalPercentBarSeries(QDECLARATIVE_ITEM *parent = 0); | |
370 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
379 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
371 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
380 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
372 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
381 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
373 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
382 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
374 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
383 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
375 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
384 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
376 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
385 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
377 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
386 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
378 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
387 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
379 |
|
388 | |||
380 | public: |
|
389 | public: | |
381 | Q_INVOKABLE DeclarativeBarSet *at(int index); |
|
390 | Q_INVOKABLE DeclarativeBarSet *at(int index); | |
382 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } |
|
391 | Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); } | |
383 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); |
|
392 | Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values); | |
384 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); } |
|
393 | Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); } | |
385 | Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); } |
|
394 | Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); } | |
386 |
|
395 | |||
387 | public: // from QDeclarativeParserStatus |
|
396 | public: // from QDeclarativeParserStatus | |
388 | void classBegin(); |
|
397 | void classBegin(); | |
389 | void componentComplete(); |
|
398 | void componentComplete(); | |
390 |
|
399 | |||
391 | Q_SIGNALS: |
|
400 | Q_SIGNALS: | |
392 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
401 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
393 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
402 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
394 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
403 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
395 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
404 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
396 |
|
405 | |||
397 | public Q_SLOTS: |
|
406 | public Q_SLOTS: | |
398 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
407 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
399 |
|
408 | |||
400 | public: |
|
409 | public: | |
401 | DeclarativeAxes *m_axes; |
|
410 | DeclarativeAxes *m_axes; | |
402 | }; |
|
411 | }; | |
403 |
|
412 | |||
404 | QTCOMMERCIALCHART_END_NAMESPACE |
|
413 | QTCOMMERCIALCHART_END_NAMESPACE | |
405 |
|
414 | |||
406 | #endif // DECLARATIVEBARSERIES_H |
|
415 | #endif // DECLARATIVEBARSERIES_H |
@@ -1,339 +1,397 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "declarativebarseries.h" |
|
21 | #include "declarativebarseries.h" | |
22 | #include "declarativeboxplotseries.h" |
|
22 | #include "declarativeboxplotseries.h" | |
23 | #include "qboxset.h" |
|
23 | #include "qboxset.h" | |
24 | #include "qvboxplotmodelmapper.h" |
|
24 | #include "qvboxplotmodelmapper.h" | |
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
27 |
|
27 | |||
28 | #ifdef QDOC_QT5 |
|
28 | #ifdef QDOC_QT5 | |
29 | /*! |
|
29 | /*! | |
30 | \qmltype BoxSet |
|
30 | \qmltype BoxSet | |
31 | \instantiates QBoxSet |
|
31 | \instantiates QBoxSet | |
32 | \inqmlmodule QtCommercial.Chart |
|
32 | \inqmlmodule QtCommercial.Chart | |
33 |
|
33 | |||
34 | \include doc/src/declarativeboxset.qdocinc |
|
34 | \include doc/src/declarativeboxset.qdocinc | |
35 | */ |
|
35 | */ | |
36 | #else |
|
36 | #else | |
37 | /*! |
|
37 | /*! | |
38 | \qmlclass BoxSet QBoxSet |
|
38 | \qmlclass BoxSet QBoxSet | |
39 |
|
39 | |||
40 | \include ../doc/src/declarativeboxset.qdocinc |
|
40 | \include ../doc/src/declarativeboxset.qdocinc | |
41 | */ |
|
41 | */ | |
42 | #endif |
|
42 | #endif | |
43 | /*! |
|
43 | /*! | |
44 | \qmlproperty string BoxSet::values |
|
44 | \qmlproperty string BoxSet::values | |
45 | The values on the box-and-whiskers set. |
|
45 | The values on the box-and-whiskers set. | |
46 | */ |
|
46 | */ | |
47 | /*! |
|
47 | /*! | |
48 | \qmlproperty string BoxSet::label |
|
48 | \qmlproperty string BoxSet::label | |
49 | Defines the label of the box-and-whiskers set. |
|
49 | Defines the label of the box-and-whiskers set. | |
50 | */ |
|
50 | */ | |
51 | /*! |
|
51 | /*! | |
52 | \qmlproperty int BoxSet::count |
|
52 | \qmlproperty int BoxSet::count | |
53 | The count of values on the box-and-whiskers set |
|
53 | The count of values on the box-and-whiskers set | |
54 | */ |
|
54 | */ | |
55 | /*! |
|
55 | /*! | |
56 | \qmlmethod void BoxSet::at(int index) |
|
56 | \qmlmethod void BoxSet::at(int index) | |
57 | Returns the value at \a index position. |
|
57 | Returns the value at \a index position. | |
58 | */ |
|
58 | */ | |
59 | /*! |
|
59 | /*! | |
60 | \qmlmethod void BoxSet::append(qreal value) |
|
60 | \qmlmethod void BoxSet::append(qreal value) | |
61 | Appends new value \a value to the end of set. |
|
61 | Appends new value \a value to the end of set. | |
62 | */ |
|
62 | */ | |
63 | /*! |
|
63 | /*! | |
64 | \qmlmethod void BoxSet::clear() |
|
64 | \qmlmethod void BoxSet::clear() | |
65 | Sets all values on the set to 0. |
|
65 | Sets all values on the set to 0. | |
66 | */ |
|
66 | */ | |
67 | /*! |
|
67 | /*! | |
68 | \qmlmethod void BoxSet::setValue(int index, qreal value) |
|
68 | \qmlmethod void BoxSet::setValue(int index, qreal value) | |
69 | Sets a new \a value on the \a index position. |
|
69 | Sets a new \a value on the \a index position. | |
70 | */ |
|
70 | */ | |
71 | /*! |
|
71 | /*! | |
72 | \qmlsignal BoxSet::onClicked() |
|
72 | \qmlsignal BoxSet::onClicked() | |
73 | This signal is emitted when the user clicks with a mouse on top of box-and-whiskers item. |
|
73 | This signal is emitted when the user clicks with a mouse on top of box-and-whiskers item. | |
74 | */ |
|
74 | */ | |
75 | /*! |
|
75 | /*! | |
76 | \qmlsignal BoxSet::onHovered(bool status) |
|
76 | \qmlsignal BoxSet::onHovered(bool status) | |
77 | The signal is emitted if mouse is hovered on top of box-and-whiskers item. |
|
77 | The signal is emitted if mouse is hovered on top of box-and-whiskers item. | |
78 | Parameter \a status is true, if mouse entered on top of the item, and false if mouse left from top of the item. |
|
78 | Parameter \a status is true, if mouse entered on top of the item, and false if mouse left from top of the item. | |
79 | */ |
|
79 | */ | |
80 | /*! |
|
80 | /*! | |
81 | \qmlsignal BoxSet::onPenChanged() |
|
81 | \qmlsignal BoxSet::onPenChanged() | |
82 | This signal is emitted when the pen of the box-and-whiskers item has changed. |
|
82 | This signal is emitted when the pen of the box-and-whiskers item has changed. | |
83 | */ |
|
83 | */ | |
84 | /*! |
|
84 | /*! | |
85 | \qmlsignal BoxSet::onBrushChanged() |
|
85 | \qmlsignal BoxSet::onBrushChanged() | |
86 | This signal is emitted when the brush of the box-and-whiskers item has changed. |
|
86 | This signal is emitted when the brush of the box-and-whiskers item has changed. | |
87 | */ |
|
87 | */ | |
88 | /*! |
|
88 | /*! | |
89 | \qmlsignal BoxSet::onChangedValues() |
|
89 | \qmlsignal BoxSet::onChangedValues() | |
90 | This signal is emitted when multiple values have been changed on the box-and-whiskers item. |
|
90 | This signal is emitted when multiple values have been changed on the box-and-whiskers item. | |
91 | */ |
|
91 | */ | |
92 | /*! |
|
92 | /*! | |
93 | \qmlsignal BoxSet::onChangedValue(int index) |
|
93 | \qmlsignal BoxSet::onChangedValue(int index) | |
94 | This signal is emitted values the value in the box-and-whiskers item has been modified. |
|
94 | This signal is emitted values the value in the box-and-whiskers item has been modified. | |
95 | Parameter \a index indicates the position of the modified value. |
|
95 | Parameter \a index indicates the position of the modified value. | |
96 | */ |
|
96 | */ | |
97 | /*! |
|
97 | /*! | |
98 | \qmlsignal BoxSet::onCleared() |
|
98 | \qmlsignal BoxSet::onCleared() | |
99 | This signal is emitted when all the values on the set are cleared to 0. |
|
99 | This signal is emitted when all the values on the set are cleared to 0. | |
100 | */ |
|
100 | */ | |
101 |
|
101 | |||
102 |
|
102 | |||
103 | #ifdef QDOC_QT5 |
|
103 | #ifdef QDOC_QT5 | |
104 | /*! |
|
104 | /*! | |
105 | \qmltype BoxPlotSeries |
|
105 | \qmltype BoxPlotSeries | |
106 | \instantiates QBoxPlotSeries |
|
106 | \instantiates QBoxPlotSeries | |
107 | \inqmlmodule QtCommercial.Chart |
|
107 | \inqmlmodule QtCommercial.Chart | |
108 |
|
108 | |||
109 | \include doc/src/declarativeboxplotseries.qdocinc |
|
109 | \include doc/src/declarativeboxplotseries.qdocinc | |
110 | */ |
|
110 | */ | |
111 | #else |
|
111 | #else | |
112 | /*! |
|
112 | /*! | |
113 | \qmlclass BoxPlotSeries QBoxPlotSeries |
|
113 | \qmlclass BoxPlotSeries QBoxPlotSeries | |
114 |
|
114 | |||
115 | \include ../doc/src/declarativeboxplotseries.qdocinc |
|
115 | \include ../doc/src/declarativeboxplotseries.qdocinc | |
116 | */ |
|
116 | */ | |
117 | #endif |
|
117 | #endif | |
118 |
|
118 | |||
119 | /*! |
|
119 | /*! | |
120 | \qmlmethod BoxPlotSeries::append(string label, VariantList values) |
|
120 | \qmlmethod BoxPlotSeries::append(string label, VariantList values) | |
121 | Appends a new box-and-whiskers set with \a label and \a values to the series. |
|
121 | Appends a new box-and-whiskers set with \a label and \a values to the series. | |
122 | */ |
|
122 | */ | |
123 | /*! |
|
123 | /*! | |
124 | \qmlmethod BoxPlotSeries::append(BoxSet box) |
|
124 | \qmlmethod BoxPlotSeries::append(BoxSet box) | |
125 | Appends the \a box to the series. |
|
125 | Appends the \a box to the series. | |
126 | */ |
|
126 | */ | |
127 | /*! |
|
127 | /*! | |
128 | \qmlmethod BoxPlotSeries::insert(int index, string label, VariantList values) |
|
128 | \qmlmethod BoxPlotSeries::insert(int index, string label, VariantList values) | |
129 | Inserts a new box-and-whiskers set with \a label and \a values at the \a index position. |
|
129 | Inserts a new box-and-whiskers set with \a label and \a values at the \a index position. | |
130 | */ |
|
130 | */ | |
131 | /*! |
|
131 | /*! | |
132 | \qmlmethod BoxPlotSeries::remove(QBoxSet boxset) |
|
132 | \qmlmethod BoxPlotSeries::remove(QBoxSet boxset) | |
133 | Removes the \a boxset from the series. |
|
133 | Removes the \a boxset from the series. | |
134 | */ |
|
134 | */ | |
135 | /*! |
|
135 | /*! | |
136 | \qmlmethod BoxPlotSeries::clear() |
|
136 | \qmlmethod BoxPlotSeries::clear() | |
137 | Removes all boxsets from the series. Deletes removed sets. |
|
137 | Removes all boxsets from the series. Deletes removed sets. | |
138 | */ |
|
138 | */ | |
139 | /*! |
|
139 | /*! | |
140 | \qmlsignal BoxPlotSeries::onClicked(BoxSet boxset); |
|
140 | \qmlsignal BoxPlotSeries::onClicked(BoxSet boxset); | |
141 | Signal is emitted when the user clicks the \a boxset on the chart. |
|
141 | Signal is emitted when the user clicks the \a boxset on the chart. | |
142 | */ |
|
142 | */ | |
143 | /*! |
|
143 | /*! | |
144 | \qmlsignal BoxPlotSeries::onHovered(bool status, BoxSet boxset); |
|
144 | \qmlsignal BoxPlotSeries::onHovered(bool status, BoxSet boxset); | |
145 | Signal is emitted when there is change in hover \a status over \a boxset. |
|
145 | Signal is emitted when there is change in hover \a status over \a boxset. | |
146 | */ |
|
146 | */ | |
147 | /*! |
|
147 | /*! | |
148 | \qmlsignal BoxPlotSeries::onCountChanged(); |
|
148 | \qmlsignal BoxPlotSeries::onCountChanged(); | |
149 | Signal is emitted when there is change in count of box-and-whiskers items in the series. |
|
149 | Signal is emitted when there is change in count of box-and-whiskers items in the series. | |
150 | */ |
|
150 | */ | |
151 | /*! |
|
151 | /*! | |
152 | \qmlsignal BoxPlotSeries::onBoxsetsAdded() |
|
152 | \qmlsignal BoxPlotSeries::onBoxsetsAdded() | |
153 | Signal is emitted when new box-and-whiskers sets are added to the series. |
|
153 | Signal is emitted when new box-and-whiskers sets are added to the series. | |
154 | */ |
|
154 | */ | |
155 | /*! |
|
155 | /*! | |
156 | \qmlsignal BoxPlotSeries::onBoxsetsRemoved() |
|
156 | \qmlsignal BoxPlotSeries::onBoxsetsRemoved() | |
157 | Signal is emitted when new box-and-whiskers sets are removed from the series. |
|
157 | Signal is emitted when new box-and-whiskers sets are removed from the series. | |
158 | */ |
|
158 | */ | |
159 | /*! |
|
159 | /*! | |
160 | \qmlproperty AbstractAxis BoxPlotSeries::axisX |
|
160 | \qmlproperty AbstractAxis BoxPlotSeries::axisX | |
161 | The x axis used for the series. If you leave both axisX and axisXTop undefined, a BarCategoriesAxis is created for |
|
161 | The x axis used for the series. If you leave both axisX and axisXTop undefined, a BarCategoriesAxis is created for | |
162 | the series. |
|
162 | the series. | |
163 | \sa axisXTop |
|
163 | \sa axisXTop | |
164 | */ |
|
164 | */ | |
165 | /*! |
|
165 | /*! | |
166 | \qmlproperty AbstractAxis BoxPlotSeries::axisY |
|
166 | \qmlproperty AbstractAxis BoxPlotSeries::axisY | |
167 | The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for |
|
167 | The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for | |
168 | the series. |
|
168 | the series. | |
169 | \sa axisYRight |
|
169 | \sa axisYRight | |
170 | */ |
|
170 | */ | |
171 | /*! |
|
171 | /*! | |
172 | \qmlproperty AbstractAxis BoxPlotSeries::axisXTop |
|
172 | \qmlproperty AbstractAxis BoxPlotSeries::axisXTop | |
173 | The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or |
|
173 | The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or | |
174 | axisXTop, but not both. |
|
174 | axisXTop, but not both. | |
175 | \sa axisX |
|
175 | \sa axisX | |
176 | */ |
|
176 | */ | |
177 | /*! |
|
177 | /*! | |
178 | \qmlproperty AbstractAxis BoxPlotSeries::axisYRight |
|
178 | \qmlproperty AbstractAxis BoxPlotSeries::axisYRight | |
179 | The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY |
|
179 | The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY | |
180 | or axisYRight, but not both. |
|
180 | or axisYRight, but not both. | |
181 | \sa axisY |
|
181 | \sa axisY | |
182 | */ |
|
182 | */ | |
183 | /*! |
|
183 | /*! | |
184 | \qmlproperty bool BoxPlotSeries::boxOutlineVisible |
|
184 | \qmlproperty bool BoxPlotSeries::boxOutlineVisible | |
185 | This property configures the visibility of the middle box outline. |
|
185 | This property configures the visibility of the middle box outline. | |
186 | */ |
|
186 | */ | |
187 | /*! |
|
187 | /*! | |
188 | \qmlproperty qreal BoxPlotSeries::boxWidth |
|
188 | \qmlproperty qreal BoxPlotSeries::boxWidth | |
189 | This property configures the width of the box-and-whiskers item. The value signifies the relative |
|
189 | This property configures the width of the box-and-whiskers item. The value signifies the relative | |
190 | width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values |
|
190 | width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values | |
191 | are clamped to 0.0 and values over 1.0 are clamped to 1.0. |
|
191 | are clamped to 0.0 and values over 1.0 are clamped to 1.0. | |
192 | */ |
|
192 | */ | |
193 | /*! |
|
193 | /*! | |
194 | \qmlproperty Pen BoxPlotSeries::pen |
|
194 | \qmlproperty Pen BoxPlotSeries::pen | |
195 | This property configures the pen of the box-and-whiskers items. |
|
195 | This property configures the pen of the box-and-whiskers items. | |
196 | */ |
|
196 | */ | |
197 | /*! |
|
197 | /*! | |
198 | \qmlproperty Brush BoxPlotSeries::brush |
|
198 | \qmlproperty Brush BoxPlotSeries::brush | |
199 | This property configures the brush of the box-and-whiskers items. |
|
199 | This property configures the brush of the box-and-whiskers items. | |
200 | */ |
|
200 | */ | |
201 | /*! |
|
201 | /*! | |
202 | \qmlsignal BoxPlotSeries::onBoxOutlineVisibilityChanged() |
|
202 | \qmlsignal BoxPlotSeries::onBoxOutlineVisibilityChanged() | |
203 | Signal is emitted when the middle box outline visibility is changed. |
|
203 | Signal is emitted when the middle box outline visibility is changed. | |
204 | */ |
|
204 | */ | |
205 | /*! |
|
205 | /*! | |
206 | \qmlsignal BoxPlotSeries::onBoxWidthChanged() |
|
206 | \qmlsignal BoxPlotSeries::onBoxWidthChanged() | |
207 | Signal is emitted when the width of the box-and-whiskers item is changed. |
|
207 | Signal is emitted when the width of the box-and-whiskers item is changed. | |
208 | */ |
|
208 | */ | |
209 | /*! |
|
209 | /*! | |
210 | \qmlsignal BoxPlotSeries::onPenChanged() |
|
210 | \qmlsignal BoxPlotSeries::onPenChanged() | |
211 | Signal is emitted when the pen for box-and-whiskers items has changed. |
|
211 | Signal is emitted when the pen for box-and-whiskers items has changed. | |
212 | */ |
|
212 | */ | |
213 | /*! |
|
213 | /*! | |
214 | \qmlsignal BoxPlotSeries::onBrushChanged() |
|
214 | \qmlsignal BoxPlotSeries::onBrushChanged() | |
215 | Signal is emitted when the brush for box-and-whiskers items has changed. |
|
215 | Signal is emitted when the brush for box-and-whiskers items has changed. | |
216 | */ |
|
216 | */ | |
217 | /*! |
|
217 | /*! | |
218 | \qmlsignal BoxPlotSeries::onClicked(BoxSet boxset) |
|
218 | \qmlsignal BoxPlotSeries::onClicked(BoxSet boxset) | |
219 | Signal is emitted when the user clicks the \a boxset on the chart. |
|
219 | Signal is emitted when the user clicks the \a boxset on the chart. | |
220 | */ |
|
220 | */ | |
221 | /*! |
|
221 | /*! | |
222 | \qmlsignal BoxPlotSeries::onHovered(bool status, BoxSet boxset) |
|
222 | \qmlsignal BoxPlotSeries::onHovered(bool status, BoxSet boxset) | |
223 | Signal is emitted when there is change in hover \a status over \a boxset. |
|
223 | Signal is emitted when there is change in hover \a status over \a boxset. | |
224 | */ |
|
224 | */ | |
225 | /*! |
|
225 | /*! | |
226 | \qmlsignal BoxPlotSeries::onAxisXChanged(AbstractAxis axis) |
|
226 | \qmlsignal BoxPlotSeries::onAxisXChanged(AbstractAxis axis) | |
227 | Signal is emitted when there is change in X axis. |
|
227 | Signal is emitted when there is change in X axis. | |
228 | */ |
|
228 | */ | |
229 | /*! |
|
229 | /*! | |
230 | \qmlsignal BoxPlotSeries::onAxisYChanged(AbstractAxis axis) |
|
230 | \qmlsignal BoxPlotSeries::onAxisYChanged(AbstractAxis axis) | |
231 | Signal is emitted when there is change in Y axis. |
|
231 | Signal is emitted when there is change in Y axis. | |
232 | */ |
|
232 | */ | |
233 | /*! |
|
233 | /*! | |
234 | \qmlsignal BoxPlotSeries::onAxisXTopChanged(AbstractAxis axis) |
|
234 | \qmlsignal BoxPlotSeries::onAxisXTopChanged(AbstractAxis axis) | |
235 | Signal is emitted when there is change in top X axis. |
|
235 | Signal is emitted when there is change in top X axis. | |
236 | */ |
|
236 | */ | |
237 | /*! |
|
237 | /*! | |
238 | \qmlsignal BoxPlotSeries::onAxisYRightChanged(AbstractAxis axis) |
|
238 | \qmlsignal BoxPlotSeries::onAxisYRightChanged(AbstractAxis axis) | |
239 | Signal is emitted when there is change in Y right axis. |
|
239 | Signal is emitted when there is change in Y right axis. | |
240 | */ |
|
240 | */ | |
241 |
|
241 | |||
242 |
|
242 | |||
243 | DeclarativeBoxSet::DeclarativeBoxSet(const QString label, QObject *parent) |
|
243 | DeclarativeBoxSet::DeclarativeBoxSet(const QString label, QObject *parent) | |
244 | : QBoxSet(label, parent) |
|
244 | : QBoxSet(label, parent) | |
245 | { |
|
245 | { | |
246 | connect(this, SIGNAL(valuesChanged()), this, SIGNAL(changedValues())); |
|
246 | connect(this, SIGNAL(valuesChanged()), this, SIGNAL(changedValues())); | |
247 | connect(this, SIGNAL(valueChanged(int)), this, SIGNAL(changedValue(int))); |
|
247 | connect(this, SIGNAL(valueChanged(int)), this, SIGNAL(changedValue(int))); | |
|
248 | connect(this, SIGNAL(brushChanged()), this, SLOT(handleBrushChanged())); | |||
248 | } |
|
249 | } | |
249 |
|
250 | |||
250 | QVariantList DeclarativeBoxSet::values() |
|
251 | QVariantList DeclarativeBoxSet::values() | |
251 | { |
|
252 | { | |
252 | QVariantList values; |
|
253 | QVariantList values; | |
253 | for (int i(0); i < 5; i++) |
|
254 | for (int i(0); i < 5; i++) | |
254 | values.append(QVariant(QBoxSet::at(i))); |
|
255 | values.append(QVariant(QBoxSet::at(i))); | |
255 | return values; |
|
256 | return values; | |
256 | } |
|
257 | } | |
257 |
|
258 | |||
258 | void DeclarativeBoxSet::setValues(QVariantList values) |
|
259 | void DeclarativeBoxSet::setValues(QVariantList values) | |
259 | { |
|
260 | { | |
260 | for (int i(0); i < values.count(); i++) { |
|
261 | for (int i(0); i < values.count(); i++) { | |
261 | if (values.at(i).canConvert(QVariant::Double)) |
|
262 | if (values.at(i).canConvert(QVariant::Double)) | |
262 | QBoxSet::append(values[i].toDouble()); |
|
263 | QBoxSet::append(values[i].toDouble()); | |
263 | } |
|
264 | } | |
264 | } |
|
265 | } | |
265 |
|
266 | |||
|
267 | QString DeclarativeBoxSet::brushFilename() const | |||
|
268 | { | |||
|
269 | return m_brushFilename; | |||
|
270 | } | |||
|
271 | ||||
|
272 | void DeclarativeBoxSet::setBrushFilename(const QString &brushFilename) | |||
|
273 | { | |||
|
274 | QImage brushImage(brushFilename); | |||
|
275 | if (QBoxSet::brush().textureImage() != brushImage) { | |||
|
276 | QBrush brush = QBoxSet::brush(); | |||
|
277 | brush.setTextureImage(brushImage); | |||
|
278 | QBoxSet::setBrush(brush); | |||
|
279 | m_brushFilename = brushFilename; | |||
|
280 | m_brushImage = brushImage; | |||
|
281 | emit brushFilenameChanged(brushFilename); | |||
|
282 | } | |||
|
283 | } | |||
|
284 | ||||
|
285 | void DeclarativeBoxSet::handleBrushChanged() | |||
|
286 | { | |||
|
287 | // If the texture image of the brush has changed along the brush | |||
|
288 | // the brush file name needs to be cleared. | |||
|
289 | if (!m_brushFilename.isEmpty() && QBoxSet::brush().textureImage() != m_brushImage) { | |||
|
290 | m_brushFilename.clear(); | |||
|
291 | emit brushFilenameChanged(QString("")); | |||
|
292 | } | |||
|
293 | } | |||
|
294 | ||||
266 | // ===================================================== |
|
295 | // ===================================================== | |
267 |
|
296 | |||
268 | DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent) : |
|
297 | DeclarativeBoxPlotSeries::DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent) : | |
269 | QBoxPlotSeries(parent), |
|
298 | QBoxPlotSeries(parent), | |
270 | m_axes(new DeclarativeAxes(this)) |
|
299 | m_axes(new DeclarativeAxes(this)) | |
271 | { |
|
300 | { | |
272 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
301 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
273 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
302 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
274 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
303 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
275 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
304 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
276 | connect(this, SIGNAL(hovered(bool, QBoxSet*)), this, SLOT(onHovered(bool, QBoxSet*))); |
|
305 | connect(this, SIGNAL(hovered(bool, QBoxSet*)), this, SLOT(onHovered(bool, QBoxSet*))); | |
277 | connect(this, SIGNAL(clicked(QBoxSet*)), this, SLOT(onClicked(QBoxSet*))); |
|
306 | connect(this, SIGNAL(clicked(QBoxSet*)), this, SLOT(onClicked(QBoxSet*))); | |
|
307 | connect(this, SIGNAL(brushChanged()), this, SLOT(handleBrushChanged())); | |||
278 | } |
|
308 | } | |
279 |
|
309 | |||
280 | void DeclarativeBoxPlotSeries::classBegin() |
|
310 | void DeclarativeBoxPlotSeries::classBegin() | |
281 | { |
|
311 | { | |
282 | } |
|
312 | } | |
283 |
|
313 | |||
284 | void DeclarativeBoxPlotSeries::componentComplete() |
|
314 | void DeclarativeBoxPlotSeries::componentComplete() | |
285 | { |
|
315 | { | |
286 | foreach (QObject *child, children()) { |
|
316 | foreach (QObject *child, children()) { | |
287 | if (qobject_cast<DeclarativeBoxSet *>(child)) { |
|
317 | if (qobject_cast<DeclarativeBoxSet *>(child)) { | |
288 | QBoxPlotSeries::append(qobject_cast<DeclarativeBoxSet *>(child)); |
|
318 | QBoxPlotSeries::append(qobject_cast<DeclarativeBoxSet *>(child)); | |
289 | } else if (qobject_cast<QVBoxPlotModelMapper *>(child)) { |
|
319 | } else if (qobject_cast<QVBoxPlotModelMapper *>(child)) { | |
290 | QVBoxPlotModelMapper *mapper = qobject_cast<QVBoxPlotModelMapper *>(child); |
|
320 | QVBoxPlotModelMapper *mapper = qobject_cast<QVBoxPlotModelMapper *>(child); | |
291 | mapper->setSeries(this); |
|
321 | mapper->setSeries(this); | |
292 | } |
|
322 | } | |
293 | } |
|
323 | } | |
294 | } |
|
324 | } | |
295 |
|
325 | |||
296 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeBoxPlotSeries::seriesChildren() |
|
326 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeBoxPlotSeries::seriesChildren() | |
297 | { |
|
327 | { | |
298 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBoxPlotSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
328 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativeBoxPlotSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
299 | } |
|
329 | } | |
300 |
|
330 | |||
301 | void DeclarativeBoxPlotSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) |
|
331 | void DeclarativeBoxPlotSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) | |
302 | { |
|
332 | { | |
303 | // Empty implementation; the children are parsed in componentComplete instead |
|
333 | // Empty implementation; the children are parsed in componentComplete instead | |
304 | Q_UNUSED(list); |
|
334 | Q_UNUSED(list); | |
305 | Q_UNUSED(element); |
|
335 | Q_UNUSED(element); | |
306 | } |
|
336 | } | |
307 |
|
337 | |||
308 | DeclarativeBoxSet *DeclarativeBoxPlotSeries::at(int index) |
|
338 | DeclarativeBoxSet *DeclarativeBoxPlotSeries::at(int index) | |
309 | { |
|
339 | { | |
310 | QList<QBoxSet *> setList = boxSets(); |
|
340 | QList<QBoxSet *> setList = boxSets(); | |
311 | if (index >= 0 && index < setList.count()) |
|
341 | if (index >= 0 && index < setList.count()) | |
312 | return qobject_cast<DeclarativeBoxSet *>(setList[index]); |
|
342 | return qobject_cast<DeclarativeBoxSet *>(setList[index]); | |
313 |
|
343 | |||
314 | return 0; |
|
344 | return 0; | |
315 | } |
|
345 | } | |
316 |
|
346 | |||
317 | DeclarativeBoxSet *DeclarativeBoxPlotSeries::insert(int index, const QString label, QVariantList values) |
|
347 | DeclarativeBoxSet *DeclarativeBoxPlotSeries::insert(int index, const QString label, QVariantList values) | |
318 | { |
|
348 | { | |
319 | DeclarativeBoxSet *barset = new DeclarativeBoxSet(label, this); |
|
349 | DeclarativeBoxSet *barset = new DeclarativeBoxSet(label, this); | |
320 | barset->setValues(values); |
|
350 | barset->setValues(values); | |
321 | if (QBoxPlotSeries::insert(index, barset)) |
|
351 | if (QBoxPlotSeries::insert(index, barset)) | |
322 | return barset; |
|
352 | return barset; | |
323 | delete barset; |
|
353 | delete barset; | |
324 | return 0; |
|
354 | return 0; | |
325 | } |
|
355 | } | |
326 |
|
356 | |||
327 | void DeclarativeBoxPlotSeries::onHovered(bool status, QBoxSet *boxset) |
|
357 | void DeclarativeBoxPlotSeries::onHovered(bool status, QBoxSet *boxset) | |
328 | { |
|
358 | { | |
329 | emit hovered(status, qobject_cast<DeclarativeBoxSet *>(boxset)); |
|
359 | emit hovered(status, qobject_cast<DeclarativeBoxSet *>(boxset)); | |
330 | } |
|
360 | } | |
331 |
|
361 | |||
332 | void DeclarativeBoxPlotSeries::onClicked(QBoxSet *boxset) |
|
362 | void DeclarativeBoxPlotSeries::onClicked(QBoxSet *boxset) | |
333 | { |
|
363 | { | |
334 | emit clicked(qobject_cast<DeclarativeBoxSet *>(boxset)); |
|
364 | emit clicked(qobject_cast<DeclarativeBoxSet *>(boxset)); | |
335 | } |
|
365 | } | |
336 |
|
366 | |||
|
367 | QString DeclarativeBoxPlotSeries::brushFilename() const | |||
|
368 | { | |||
|
369 | return m_brushFilename; | |||
|
370 | } | |||
|
371 | ||||
|
372 | void DeclarativeBoxPlotSeries::setBrushFilename(const QString &brushFilename) | |||
|
373 | { | |||
|
374 | QImage brushImage(brushFilename); | |||
|
375 | if (QBoxPlotSeries::brush().textureImage() != brushImage) { | |||
|
376 | QBrush brush = QBoxPlotSeries::brush(); | |||
|
377 | brush.setTextureImage(brushImage); | |||
|
378 | QBoxPlotSeries::setBrush(brush); | |||
|
379 | m_brushFilename = brushFilename; | |||
|
380 | m_brushImage = brushImage; | |||
|
381 | emit brushFilenameChanged(brushFilename); | |||
|
382 | } | |||
|
383 | } | |||
|
384 | ||||
|
385 | void DeclarativeBoxPlotSeries::handleBrushChanged() | |||
|
386 | { | |||
|
387 | // If the texture image of the brush has changed along the brush | |||
|
388 | // the brush file name needs to be cleared. | |||
|
389 | if (!m_brushFilename.isEmpty() && QBoxPlotSeries::brush().textureImage() != m_brushImage) { | |||
|
390 | m_brushFilename.clear(); | |||
|
391 | emit brushFilenameChanged(QString("")); | |||
|
392 | } | |||
|
393 | } | |||
|
394 | ||||
337 | #include "moc_declarativeboxplotseries.cpp" |
|
395 | #include "moc_declarativeboxplotseries.cpp" | |
338 |
|
396 | |||
339 | QTCOMMERCIALCHART_END_NAMESPACE |
|
397 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,132 +1,154 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEBOXPLOT_H |
|
21 | #ifndef DECLARATIVEBOXPLOT_H | |
22 | #define DECLARATIVEBOXPLOT_H |
|
22 | #define DECLARATIVEBOXPLOT_H | |
23 |
|
23 | |||
24 | #include "qboxset.h" |
|
24 | #include "qboxset.h" | |
25 | #include "declarativeaxes.h" |
|
25 | #include "declarativeaxes.h" | |
26 | #include "qboxplotseries.h" |
|
26 | #include "qboxplotseries.h" | |
27 | #ifdef CHARTS_FOR_QUICK2 |
|
27 | #ifdef CHARTS_FOR_QUICK2 | |
28 | #include <QtQuick/QQuickItem> |
|
28 | #include <QtQuick/QQuickItem> | |
29 | #include <QtQml/QQmlParserStatus> |
|
29 | #include <QtQml/QQmlParserStatus> | |
30 | #else |
|
30 | #else | |
31 | #include <QtDeclarative/QDeclarativeItem> |
|
31 | #include <QtDeclarative/QDeclarativeItem> | |
32 | #include <QtDeclarative/QDeclarativeParserStatus> |
|
32 | #include <QtDeclarative/QDeclarativeParserStatus> | |
33 | #endif |
|
33 | #endif | |
34 |
|
34 | |||
35 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
35 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
36 |
|
36 | |||
37 | class DeclarativeBoxSet : public QBoxSet |
|
37 | class DeclarativeBoxSet : public QBoxSet | |
38 | { |
|
38 | { | |
39 | Q_OBJECT |
|
39 | Q_OBJECT | |
40 | Q_PROPERTY(QVariantList values READ values WRITE setValues) |
|
40 | Q_PROPERTY(QVariantList values READ values WRITE setValues) | |
41 | Q_PROPERTY(QString label READ label WRITE setLabel) |
|
41 | Q_PROPERTY(QString label READ label WRITE setLabel) | |
42 | Q_PROPERTY(int count READ count) |
|
42 | Q_PROPERTY(int count READ count) | |
|
43 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 1) | |||
43 | Q_ENUMS(ValuePositions) |
|
44 | Q_ENUMS(ValuePositions) | |
44 |
|
45 | |||
45 | public: // duplicate from QBoxSet |
|
46 | public: // duplicate from QBoxSet | |
46 | enum ValuePositions { |
|
47 | enum ValuePositions { | |
47 | LowerExtreme = 0x0, |
|
48 | LowerExtreme = 0x0, | |
48 | LowerQuartile, |
|
49 | LowerQuartile, | |
49 | Median, |
|
50 | Median, | |
50 | UpperQuartile, |
|
51 | UpperQuartile, | |
51 | UpperExtreme |
|
52 | UpperExtreme | |
52 | }; |
|
53 | }; | |
53 |
|
54 | |||
54 | public: |
|
55 | public: | |
55 | explicit DeclarativeBoxSet(const QString label = "", QObject *parent = 0); |
|
56 | explicit DeclarativeBoxSet(const QString label = "", QObject *parent = 0); | |
56 | QVariantList values(); |
|
57 | QVariantList values(); | |
57 | void setValues(QVariantList values); |
|
58 | void setValues(QVariantList values); | |
|
59 | QString brushFilename() const; | |||
|
60 | void setBrushFilename(const QString &brushFilename); | |||
58 |
|
61 | |||
59 | public: // From QBoxSet |
|
62 | public: // From QBoxSet | |
60 | Q_INVOKABLE void append(qreal value) { QBoxSet::append(value); } |
|
63 | Q_INVOKABLE void append(qreal value) { QBoxSet::append(value); } | |
61 | Q_INVOKABLE void clear() {QBoxSet::clear(); } |
|
64 | Q_INVOKABLE void clear() {QBoxSet::clear(); } | |
62 | Q_INVOKABLE qreal at(int index) { return QBoxSet::at(index); } |
|
65 | Q_INVOKABLE qreal at(int index) { return QBoxSet::at(index); } | |
63 | Q_INVOKABLE void setValue(int index, qreal value) { QBoxSet::setValue(index, value); } |
|
66 | Q_INVOKABLE void setValue(int index, qreal value) { QBoxSet::setValue(index, value); } | |
64 |
|
67 | |||
65 | Q_SIGNALS: |
|
68 | Q_SIGNALS: | |
66 | void changedValues(); |
|
69 | void changedValues(); | |
67 | void changedValue(int index); |
|
70 | void changedValue(int index); | |
|
71 | Q_REVISION(1) void brushFilenameChanged(const QString &brushFilename); | |||
|
72 | ||||
|
73 | private Q_SLOTS: | |||
|
74 | void handleBrushChanged(); | |||
|
75 | ||||
|
76 | private: | |||
|
77 | QString m_brushFilename; | |||
|
78 | QImage m_brushImage; | |||
68 | }; |
|
79 | }; | |
69 |
|
80 | |||
70 | class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QDECLARATIVE_PARSER_STATUS |
|
81 | class DeclarativeBoxPlotSeries : public QBoxPlotSeries, public QDECLARATIVE_PARSER_STATUS | |
71 | { |
|
82 | { | |
72 | Q_OBJECT |
|
83 | Q_OBJECT | |
73 | #ifdef CHARTS_FOR_QUICK2 |
|
84 | #ifdef CHARTS_FOR_QUICK2 | |
74 | Q_INTERFACES(QQmlParserStatus) |
|
85 | Q_INTERFACES(QQmlParserStatus) | |
75 | #else |
|
86 | #else | |
76 | Q_INTERFACES(QDeclarativeParserStatus) |
|
87 | Q_INTERFACES(QDeclarativeParserStatus) | |
77 | #endif |
|
88 | #endif | |
78 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged) |
|
89 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged) | |
79 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged) |
|
90 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged) | |
80 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged) |
|
91 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged) | |
81 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged) |
|
92 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged) | |
82 | #ifdef CHARTS_FOR_QUICK2 |
|
93 | #ifdef CHARTS_FOR_QUICK2 | |
83 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
94 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
84 | #else |
|
95 | #else | |
85 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
96 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
86 | #endif |
|
97 | #endif | |
|
98 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 1) | |||
87 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
99 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
88 |
|
100 | |||
89 | public: |
|
101 | public: | |
90 | explicit DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent = 0); |
|
102 | explicit DeclarativeBoxPlotSeries(QDECLARATIVE_ITEM *parent = 0); | |
91 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
103 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
92 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
104 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
93 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
105 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
94 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
106 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
95 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
107 | QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
96 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
108 | void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
97 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
109 | QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
98 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
110 | void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
99 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
111 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
|
112 | QString brushFilename() const; | |||
|
113 | void setBrushFilename(const QString &brushFilename); | |||
100 |
|
114 | |||
101 | public: |
|
115 | public: | |
102 | Q_INVOKABLE DeclarativeBoxSet *at(int index); |
|
116 | Q_INVOKABLE DeclarativeBoxSet *at(int index); | |
103 | Q_INVOKABLE DeclarativeBoxSet *append(const QString label, QVariantList values) { return insert(count(), label, values); } |
|
117 | Q_INVOKABLE DeclarativeBoxSet *append(const QString label, QVariantList values) { return insert(count(), label, values); } | |
104 | Q_INVOKABLE void append(DeclarativeBoxSet *box) { QBoxPlotSeries::append(box); } |
|
118 | Q_INVOKABLE void append(DeclarativeBoxSet *box) { QBoxPlotSeries::append(box); } | |
105 | Q_INVOKABLE DeclarativeBoxSet *insert(int index, const QString label, QVariantList values); |
|
119 | Q_INVOKABLE DeclarativeBoxSet *insert(int index, const QString label, QVariantList values); | |
106 | Q_INVOKABLE bool remove(DeclarativeBoxSet *box) { return QBoxPlotSeries::remove(qobject_cast<QBoxSet *>(box)); } |
|
120 | Q_INVOKABLE bool remove(DeclarativeBoxSet *box) { return QBoxPlotSeries::remove(qobject_cast<QBoxSet *>(box)); } | |
107 | Q_INVOKABLE void clear() { return QBoxPlotSeries::clear(); } |
|
121 | Q_INVOKABLE void clear() { return QBoxPlotSeries::clear(); } | |
108 |
|
122 | |||
109 | public: // from QDeclarativeParserStatus |
|
123 | public: // from QDeclarativeParserStatus | |
110 | void classBegin(); |
|
124 | void classBegin(); | |
111 | void componentComplete(); |
|
125 | void componentComplete(); | |
112 |
|
126 | |||
113 | Q_SIGNALS: |
|
127 | Q_SIGNALS: | |
114 | void axisXChanged(QAbstractAxis *axis); |
|
128 | void axisXChanged(QAbstractAxis *axis); | |
115 | void axisYChanged(QAbstractAxis *axis); |
|
129 | void axisYChanged(QAbstractAxis *axis); | |
116 | void axisXTopChanged(QAbstractAxis *axis); |
|
130 | void axisXTopChanged(QAbstractAxis *axis); | |
117 | void axisYRightChanged(QAbstractAxis *axis); |
|
131 | void axisYRightChanged(QAbstractAxis *axis); | |
118 | void clicked(DeclarativeBoxSet *boxset); |
|
132 | void clicked(DeclarativeBoxSet *boxset); | |
119 | void hovered(bool status, DeclarativeBoxSet *boxset); |
|
133 | void hovered(bool status, DeclarativeBoxSet *boxset); | |
|
134 | Q_REVISION(1) void brushFilenameChanged(const QString &brushFilename); | |||
120 |
|
135 | |||
121 | public Q_SLOTS: |
|
136 | public Q_SLOTS: | |
122 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
137 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
123 | void onHovered(bool status, QBoxSet *boxset); |
|
138 | void onHovered(bool status, QBoxSet *boxset); | |
124 | void onClicked(QBoxSet *boxset); |
|
139 | void onClicked(QBoxSet *boxset); | |
125 |
|
140 | |||
|
141 | private Q_SLOTS: | |||
|
142 | void handleBrushChanged(); | |||
|
143 | ||||
126 | public: |
|
144 | public: | |
127 | DeclarativeAxes *m_axes; |
|
145 | DeclarativeAxes *m_axes; | |
|
146 | ||||
|
147 | private: | |||
|
148 | QString m_brushFilename; | |||
|
149 | QImage m_brushImage; | |||
128 | }; |
|
150 | }; | |
129 |
|
151 | |||
130 | QTCOMMERCIALCHART_END_NAMESPACE |
|
152 | QTCOMMERCIALCHART_END_NAMESPACE | |
131 |
|
153 | |||
132 | #endif // DECLARATIVEBOXPLOT_H |
|
154 | #endif // DECLARATIVEBOXPLOT_H |
@@ -1,117 +1,154 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "declarativepieseries.h" |
|
21 | #include "declarativepieseries.h" | |
22 | #include "qpieslice.h" |
|
22 | #include "qpieslice.h" | |
23 | #include "qvpiemodelmapper.h" |
|
23 | #include "qvpiemodelmapper.h" | |
24 | #include "qhpiemodelmapper.h" |
|
24 | #include "qhpiemodelmapper.h" | |
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
27 |
|
27 | |||
|
28 | DeclarativePieSlice::DeclarativePieSlice(QObject *parent) | |||
|
29 | : QPieSlice(parent) | |||
|
30 | { | |||
|
31 | connect(this, SIGNAL(brushChanged()), this, SLOT(handleBrushChanged())); | |||
|
32 | } | |||
|
33 | ||||
|
34 | QString DeclarativePieSlice::brushFilename() const | |||
|
35 | { | |||
|
36 | return m_brushFilename; | |||
|
37 | } | |||
|
38 | ||||
|
39 | void DeclarativePieSlice::setBrushFilename(const QString &brushFilename) | |||
|
40 | { | |||
|
41 | QImage brushImage(brushFilename); | |||
|
42 | if (QPieSlice::brush().textureImage() != brushImage) { | |||
|
43 | QBrush brush = QPieSlice::brush(); | |||
|
44 | brush.setTextureImage(brushImage); | |||
|
45 | QPieSlice::setBrush(brush); | |||
|
46 | m_brushFilename = brushFilename; | |||
|
47 | m_brushImage = brushImage; | |||
|
48 | emit brushFilenameChanged(brushFilename); | |||
|
49 | } | |||
|
50 | } | |||
|
51 | ||||
|
52 | void DeclarativePieSlice::handleBrushChanged() | |||
|
53 | { | |||
|
54 | // If the texture image of the brush has changed along the brush | |||
|
55 | // the brush file name needs to be cleared. | |||
|
56 | if (!m_brushFilename.isEmpty() && QPieSlice::brush().textureImage() != m_brushImage) { | |||
|
57 | m_brushFilename.clear(); | |||
|
58 | emit brushFilenameChanged(QString("")); | |||
|
59 | } | |||
|
60 | } | |||
|
61 | ||||
|
62 | // Declarative pie series ========================================================================= | |||
28 | DeclarativePieSeries::DeclarativePieSeries(QDECLARATIVE_ITEM *parent) : |
|
63 | DeclarativePieSeries::DeclarativePieSeries(QDECLARATIVE_ITEM *parent) : | |
29 | QPieSeries(parent) |
|
64 | QPieSeries(parent) | |
30 | { |
|
65 | { | |
31 | connect(this, SIGNAL(added(QList<QPieSlice*>)), this, SLOT(handleAdded(QList<QPieSlice*>))); |
|
66 | connect(this, SIGNAL(added(QList<QPieSlice*>)), this, SLOT(handleAdded(QList<QPieSlice*>))); | |
32 | connect(this, SIGNAL(removed(QList<QPieSlice*>)), this, SLOT(handleRemoved(QList<QPieSlice*>))); |
|
67 | connect(this, SIGNAL(removed(QList<QPieSlice*>)), this, SLOT(handleRemoved(QList<QPieSlice*>))); | |
33 | } |
|
68 | } | |
34 |
|
69 | |||
35 | void DeclarativePieSeries::classBegin() |
|
70 | void DeclarativePieSeries::classBegin() | |
36 | { |
|
71 | { | |
37 | } |
|
72 | } | |
38 |
|
73 | |||
39 | void DeclarativePieSeries::componentComplete() |
|
74 | void DeclarativePieSeries::componentComplete() | |
40 | { |
|
75 | { | |
41 | foreach (QObject *child, children()) { |
|
76 | foreach (QObject *child, children()) { | |
42 | if (qobject_cast<QPieSlice *>(child)) { |
|
77 | if (qobject_cast<QPieSlice *>(child)) { | |
43 | QPieSeries::append(qobject_cast<QPieSlice *>(child)); |
|
78 | QPieSeries::append(qobject_cast<QPieSlice *>(child)); | |
44 | } else if (qobject_cast<QVPieModelMapper *>(child)) { |
|
79 | } else if (qobject_cast<QVPieModelMapper *>(child)) { | |
45 | QVPieModelMapper *mapper = qobject_cast<QVPieModelMapper *>(child); |
|
80 | QVPieModelMapper *mapper = qobject_cast<QVPieModelMapper *>(child); | |
46 | mapper->setSeries(this); |
|
81 | mapper->setSeries(this); | |
47 | } else if (qobject_cast<QHPieModelMapper *>(child)) { |
|
82 | } else if (qobject_cast<QHPieModelMapper *>(child)) { | |
48 | QHPieModelMapper *mapper = qobject_cast<QHPieModelMapper *>(child); |
|
83 | QHPieModelMapper *mapper = qobject_cast<QHPieModelMapper *>(child); | |
49 | mapper->setSeries(this); |
|
84 | mapper->setSeries(this); | |
50 | } |
|
85 | } | |
51 | } |
|
86 | } | |
52 | } |
|
87 | } | |
53 |
|
88 | |||
54 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativePieSeries::seriesChildren() |
|
89 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativePieSeries::seriesChildren() | |
55 | { |
|
90 | { | |
56 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativePieSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
91 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &DeclarativePieSeries::appendSeriesChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
57 | } |
|
92 | } | |
58 |
|
93 | |||
59 | void DeclarativePieSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) |
|
94 | void DeclarativePieSeries::appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> * list, QObject *element) | |
60 | { |
|
95 | { | |
61 | // Empty implementation; the children are parsed in componentComplete instead |
|
96 | // Empty implementation; the children are parsed in componentComplete instead | |
62 | Q_UNUSED(list); |
|
97 | Q_UNUSED(list); | |
63 | Q_UNUSED(element); |
|
98 | Q_UNUSED(element); | |
64 | } |
|
99 | } | |
65 |
|
100 | |||
66 | QPieSlice *DeclarativePieSeries::at(int index) |
|
101 | QPieSlice *DeclarativePieSeries::at(int index) | |
67 | { |
|
102 | { | |
68 | QList<QPieSlice *> sliceList = slices(); |
|
103 | QList<QPieSlice *> sliceList = slices(); | |
69 | if (index >= 0 && index < sliceList.count()) |
|
104 | if (index >= 0 && index < sliceList.count()) | |
70 | return sliceList[index]; |
|
105 | return sliceList[index]; | |
71 |
|
106 | |||
72 | return 0; |
|
107 | return 0; | |
73 | } |
|
108 | } | |
74 |
|
109 | |||
75 | QPieSlice *DeclarativePieSeries::find(QString label) |
|
110 | QPieSlice *DeclarativePieSeries::find(QString label) | |
76 | { |
|
111 | { | |
77 | foreach (QPieSlice *slice, slices()) { |
|
112 | foreach (QPieSlice *slice, slices()) { | |
78 | if (slice->label() == label) |
|
113 | if (slice->label() == label) | |
79 | return slice; |
|
114 | return slice; | |
80 | } |
|
115 | } | |
81 | return 0; |
|
116 | return 0; | |
82 | } |
|
117 | } | |
83 |
|
118 | |||
84 |
|
|
119 | DeclarativePieSlice *DeclarativePieSeries::append(QString label, qreal value) | |
85 | { |
|
120 | { | |
86 |
|
|
121 | DeclarativePieSlice *slice = new DeclarativePieSlice(this); | |
87 | slice->setLabel(label); |
|
122 | slice->setLabel(label); | |
88 | slice->setValue(value); |
|
123 | slice->setValue(value); | |
89 |
QPieSeries::append(slice) |
|
124 | if (QPieSeries::append(slice)) | |
90 | return slice; |
|
125 | return slice; | |
|
126 | delete slice; | |||
|
127 | return 0; | |||
91 | } |
|
128 | } | |
92 |
|
129 | |||
93 | bool DeclarativePieSeries::remove(QPieSlice *slice) |
|
130 | bool DeclarativePieSeries::remove(QPieSlice *slice) | |
94 | { |
|
131 | { | |
95 | return QPieSeries::remove(slice); |
|
132 | return QPieSeries::remove(slice); | |
96 | } |
|
133 | } | |
97 |
|
134 | |||
98 | void DeclarativePieSeries::clear() |
|
135 | void DeclarativePieSeries::clear() | |
99 | { |
|
136 | { | |
100 | QPieSeries::clear(); |
|
137 | QPieSeries::clear(); | |
101 | } |
|
138 | } | |
102 |
|
139 | |||
103 | void DeclarativePieSeries::handleAdded(QList<QPieSlice *> slices) |
|
140 | void DeclarativePieSeries::handleAdded(QList<QPieSlice *> slices) | |
104 | { |
|
141 | { | |
105 | foreach (QPieSlice *slice, slices) |
|
142 | foreach (QPieSlice *slice, slices) | |
106 | emit sliceAdded(slice); |
|
143 | emit sliceAdded(slice); | |
107 | } |
|
144 | } | |
108 |
|
145 | |||
109 | void DeclarativePieSeries::handleRemoved(QList<QPieSlice *> slices) |
|
146 | void DeclarativePieSeries::handleRemoved(QList<QPieSlice *> slices) | |
110 | { |
|
147 | { | |
111 | foreach (QPieSlice *slice, slices) |
|
148 | foreach (QPieSlice *slice, slices) | |
112 | emit sliceRemoved(slice); |
|
149 | emit sliceRemoved(slice); | |
113 | } |
|
150 | } | |
114 |
|
151 | |||
115 | #include "moc_declarativepieseries.cpp" |
|
152 | #include "moc_declarativepieseries.cpp" | |
116 |
|
153 | |||
117 | QTCOMMERCIALCHART_END_NAMESPACE |
|
154 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,75 +1,96 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVEPIESERIES_H |
|
21 | #ifndef DECLARATIVEPIESERIES_H | |
22 | #define DECLARATIVEPIESERIES_H |
|
22 | #define DECLARATIVEPIESERIES_H | |
23 |
|
23 | |||
24 | #include "qpieseries.h" |
|
24 | #include "qpieseries.h" | |
|
25 | #include "qpieslice.h" | |||
25 | #include "shared_defines.h" |
|
26 | #include "shared_defines.h" | |
26 |
|
27 | |||
27 | #ifdef CHARTS_FOR_QUICK2 |
|
28 | #ifdef CHARTS_FOR_QUICK2 | |
28 | #include <QtQuick/QQuickItem> |
|
29 | #include <QtQuick/QQuickItem> | |
29 | #include <QtQml/QQmlParserStatus> |
|
30 | #include <QtQml/QQmlParserStatus> | |
30 | #else |
|
31 | #else | |
31 | #include <QtDeclarative/QDeclarativeItem> |
|
32 | #include <QtDeclarative/QDeclarativeItem> | |
32 | #include <QtDeclarative/QDeclarativeParserStatus> |
|
33 | #include <QtDeclarative/QDeclarativeParserStatus> | |
33 | #endif |
|
34 | #endif | |
34 |
|
35 | |||
35 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
36 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
36 | class QPieSlice; |
|
37 | ||
|
38 | class DeclarativePieSlice : public QPieSlice | |||
|
39 | { | |||
|
40 | Q_OBJECT | |||
|
41 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged) | |||
|
42 | ||||
|
43 | public: | |||
|
44 | explicit DeclarativePieSlice(QObject *parent = 0); | |||
|
45 | QString brushFilename() const; | |||
|
46 | void setBrushFilename(const QString &brushFilename); | |||
|
47 | ||||
|
48 | Q_SIGNALS: | |||
|
49 | void brushFilenameChanged(const QString &brushFilename); | |||
|
50 | ||||
|
51 | private Q_SLOTS: | |||
|
52 | void handleBrushChanged(); | |||
|
53 | ||||
|
54 | private: | |||
|
55 | QString m_brushFilename; | |||
|
56 | QImage m_brushImage; | |||
|
57 | }; | |||
37 |
|
58 | |||
38 | class DeclarativePieSeries : public QPieSeries, public QDECLARATIVE_PARSER_STATUS |
|
59 | class DeclarativePieSeries : public QPieSeries, public QDECLARATIVE_PARSER_STATUS | |
39 | { |
|
60 | { | |
40 | Q_OBJECT |
|
61 | Q_OBJECT | |
41 | #ifdef CHARTS_FOR_QUICK2 |
|
62 | #ifdef CHARTS_FOR_QUICK2 | |
42 | Q_INTERFACES(QQmlParserStatus) |
|
63 | Q_INTERFACES(QQmlParserStatus) | |
43 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) |
|
64 | Q_PROPERTY(QQmlListProperty<QObject> seriesChildren READ seriesChildren) | |
44 | #else |
|
65 | #else | |
45 | Q_INTERFACES(QDeclarativeParserStatus) |
|
66 | Q_INTERFACES(QDeclarativeParserStatus) | |
46 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) |
|
67 | Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren) | |
47 | #endif |
|
68 | #endif | |
48 | Q_CLASSINFO("DefaultProperty", "seriesChildren") |
|
69 | Q_CLASSINFO("DefaultProperty", "seriesChildren") | |
49 |
|
70 | |||
50 | public: |
|
71 | public: | |
51 | explicit DeclarativePieSeries(QDECLARATIVE_ITEM *parent = 0); |
|
72 | explicit DeclarativePieSeries(QDECLARATIVE_ITEM *parent = 0); | |
52 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); |
|
73 | QDECLARATIVE_LIST_PROPERTY<QObject> seriesChildren(); | |
53 | Q_INVOKABLE QPieSlice *at(int index); |
|
74 | Q_INVOKABLE QPieSlice *at(int index); | |
54 | Q_INVOKABLE QPieSlice *find(QString label); |
|
75 | Q_INVOKABLE QPieSlice *find(QString label); | |
55 |
Q_INVOKABLE |
|
76 | Q_INVOKABLE DeclarativePieSlice *append(QString label, qreal value); | |
56 | Q_INVOKABLE bool remove(QPieSlice *slice); |
|
77 | Q_INVOKABLE bool remove(QPieSlice *slice); | |
57 | Q_INVOKABLE void clear(); |
|
78 | Q_INVOKABLE void clear(); | |
58 |
|
79 | |||
59 | public: |
|
80 | public: | |
60 | void classBegin(); |
|
81 | void classBegin(); | |
61 | void componentComplete(); |
|
82 | void componentComplete(); | |
62 |
|
83 | |||
63 | Q_SIGNALS: |
|
84 | Q_SIGNALS: | |
64 | void sliceAdded(QPieSlice *slice); |
|
85 | void sliceAdded(QPieSlice *slice); | |
65 | void sliceRemoved(QPieSlice *slice); |
|
86 | void sliceRemoved(QPieSlice *slice); | |
66 |
|
87 | |||
67 | public Q_SLOTS: |
|
88 | public Q_SLOTS: | |
68 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
89 | static void appendSeriesChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
69 | void handleAdded(QList<QPieSlice *> slices); |
|
90 | void handleAdded(QList<QPieSlice *> slices); | |
70 | void handleRemoved(QList<QPieSlice *> slices); |
|
91 | void handleRemoved(QList<QPieSlice *> slices); | |
71 | }; |
|
92 | }; | |
72 |
|
93 | |||
73 | QTCOMMERCIALCHART_END_NAMESPACE |
|
94 | QTCOMMERCIALCHART_END_NAMESPACE | |
74 |
|
95 | |||
75 | #endif // DECLARATIVEPIESERIES_H |
|
96 | #endif // DECLARATIVEPIESERIES_H |
@@ -1,74 +1,114 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "declarativescatterseries.h" |
|
21 | #include "declarativescatterseries.h" | |
22 |
|
22 | |||
23 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
23 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
24 |
|
24 | |||
25 | DeclarativeScatterSeries::DeclarativeScatterSeries(QObject *parent) : |
|
25 | DeclarativeScatterSeries::DeclarativeScatterSeries(QObject *parent) : | |
26 | QScatterSeries(parent), |
|
26 | QScatterSeries(parent), | |
27 | m_axes(new DeclarativeAxes(this)) |
|
27 | m_axes(new DeclarativeAxes(this)) | |
28 | { |
|
28 | { | |
29 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); |
|
29 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisXChanged(QAbstractAxis*))); | |
30 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); |
|
30 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisYChanged(QAbstractAxis*))); | |
31 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); |
|
31 | connect(m_axes, SIGNAL(axisXTopChanged(QAbstractAxis*)), this, SIGNAL(axisXTopChanged(QAbstractAxis*))); | |
32 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); |
|
32 | connect(m_axes, SIGNAL(axisYRightChanged(QAbstractAxis*)), this, SIGNAL(axisYRightChanged(QAbstractAxis*))); | |
33 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisAngularChanged(QAbstractAxis*))); |
|
33 | connect(m_axes, SIGNAL(axisXChanged(QAbstractAxis*)), this, SIGNAL(axisAngularChanged(QAbstractAxis*))); | |
34 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisRadialChanged(QAbstractAxis*))); |
|
34 | connect(m_axes, SIGNAL(axisYChanged(QAbstractAxis*)), this, SIGNAL(axisRadialChanged(QAbstractAxis*))); | |
35 | connect(this, SIGNAL(pointAdded(int)), this, SLOT(handleCountChanged(int))); |
|
35 | connect(this, SIGNAL(pointAdded(int)), this, SLOT(handleCountChanged(int))); | |
36 | connect(this, SIGNAL(pointRemoved(int)), this, SLOT(handleCountChanged(int))); |
|
36 | connect(this, SIGNAL(pointRemoved(int)), this, SLOT(handleCountChanged(int))); | |
|
37 | connect(this, SIGNAL(brushChanged()), this, SLOT(handleBrushChanged())); | |||
37 | } |
|
38 | } | |
38 |
|
39 | |||
39 | void DeclarativeScatterSeries::handleCountChanged(int index) |
|
40 | void DeclarativeScatterSeries::handleCountChanged(int index) | |
40 | { |
|
41 | { | |
41 | Q_UNUSED(index) |
|
42 | Q_UNUSED(index) | |
42 | emit countChanged(QScatterSeries::count()); |
|
43 | emit countChanged(QScatterSeries::count()); | |
43 | } |
|
44 | } | |
44 |
|
45 | |||
45 | qreal DeclarativeScatterSeries::borderWidth() const |
|
46 | qreal DeclarativeScatterSeries::borderWidth() const | |
46 | { |
|
47 | { | |
47 | return pen().widthF(); |
|
48 | return pen().widthF(); | |
48 | } |
|
49 | } | |
49 |
|
50 | |||
50 | void DeclarativeScatterSeries::setBorderWidth(qreal width) |
|
51 | void DeclarativeScatterSeries::setBorderWidth(qreal width) | |
51 | { |
|
52 | { | |
52 | if (width != pen().widthF()) { |
|
53 | if (width != pen().widthF()) { | |
53 | QPen p = pen(); |
|
54 | QPen p = pen(); | |
54 | p.setWidthF(width); |
|
55 | p.setWidthF(width); | |
55 | setPen(p); |
|
56 | setPen(p); | |
56 | emit borderWidthChanged(width); |
|
57 | emit borderWidthChanged(width); | |
57 | } |
|
58 | } | |
58 | } |
|
59 | } | |
59 |
|
60 | |||
60 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeScatterSeries::declarativeChildren() |
|
61 | QDECLARATIVE_LIST_PROPERTY<QObject> DeclarativeScatterSeries::declarativeChildren() | |
61 | { |
|
62 | { | |
62 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &appendDeclarativeChildren LIST_PROPERTY_PARAM_DEFAULTS); |
|
63 | return QDECLARATIVE_LIST_PROPERTY<QObject>(this, 0, &appendDeclarativeChildren LIST_PROPERTY_PARAM_DEFAULTS); | |
63 | } |
|
64 | } | |
64 |
|
65 | |||
65 | void DeclarativeScatterSeries::appendDeclarativeChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) |
|
66 | void DeclarativeScatterSeries::appendDeclarativeChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element) | |
66 | { |
|
67 | { | |
67 | Q_UNUSED(list) |
|
68 | Q_UNUSED(list) | |
68 | Q_UNUSED(element) |
|
69 | Q_UNUSED(element) | |
69 | // Empty implementation, children are parsed in componentComplete |
|
70 | // Empty implementation, children are parsed in componentComplete | |
70 | } |
|
71 | } | |
71 |
|
72 | |||
|
73 | QString DeclarativeScatterSeries::brushFilename() const | |||
|
74 | { | |||
|
75 | return m_brushFilename; | |||
|
76 | } | |||
|
77 | ||||
|
78 | void DeclarativeScatterSeries::setBrushFilename(const QString &brushFilename) | |||
|
79 | { | |||
|
80 | QImage brushImage(brushFilename); | |||
|
81 | if (QScatterSeries::brush().textureImage() != brushImage) { | |||
|
82 | QBrush brush = QScatterSeries::brush(); | |||
|
83 | brush.setTextureImage(brushImage); | |||
|
84 | QScatterSeries::setBrush(brush); | |||
|
85 | m_brushFilename = brushFilename; | |||
|
86 | m_brushImage = brushImage; | |||
|
87 | emit brushFilenameChanged(brushFilename); | |||
|
88 | } | |||
|
89 | } | |||
|
90 | ||||
|
91 | void DeclarativeScatterSeries::setBrush(const QBrush &brush) | |||
|
92 | { | |||
|
93 | QScatterSeries::setBrush(brush); | |||
|
94 | emit brushChanged(); | |||
|
95 | } | |||
|
96 | ||||
|
97 | QBrush DeclarativeScatterSeries::brush() const | |||
|
98 | { | |||
|
99 | return QScatterSeries::brush(); | |||
|
100 | } | |||
|
101 | ||||
|
102 | void DeclarativeScatterSeries::handleBrushChanged() | |||
|
103 | { | |||
|
104 | // If the texture image of the brush has changed along the brush | |||
|
105 | // the brush file name needs to be cleared. | |||
|
106 | if (!m_brushFilename.isEmpty() && QScatterSeries::brush().textureImage() != m_brushImage) { | |||
|
107 | m_brushFilename.clear(); | |||
|
108 | emit brushFilenameChanged(QString("")); | |||
|
109 | } | |||
|
110 | } | |||
|
111 | ||||
72 | #include "moc_declarativescatterseries.cpp" |
|
112 | #include "moc_declarativescatterseries.cpp" | |
73 |
|
113 | |||
74 | QTCOMMERCIALCHART_END_NAMESPACE |
|
114 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,115 +1,130 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef DECLARATIVESCATTERSERIES_H |
|
21 | #ifndef DECLARATIVESCATTERSERIES_H | |
22 | #define DECLARATIVESCATTERSERIES_H |
|
22 | #define DECLARATIVESCATTERSERIES_H | |
23 |
|
23 | |||
24 | #include "qscatterseries.h" |
|
24 | #include "qscatterseries.h" | |
25 | #include "declarativexyseries.h" |
|
25 | #include "declarativexyseries.h" | |
26 | #include "declarativeaxes.h" |
|
26 | #include "declarativeaxes.h" | |
27 | #include "shared_defines.h" |
|
27 | #include "shared_defines.h" | |
28 |
|
28 | |||
29 | #ifdef CHARTS_FOR_QUICK2 |
|
29 | #ifdef CHARTS_FOR_QUICK2 | |
30 | #include <QtQml/QQmlListProperty> |
|
30 | #include <QtQml/QQmlListProperty> | |
31 | #include <QtQml/QQmlParserStatus> |
|
31 | #include <QtQml/QQmlParserStatus> | |
32 | #else |
|
32 | #else | |
33 | #include <QtDeclarative/QDeclarativeListProperty> |
|
33 | #include <QtDeclarative/QDeclarativeListProperty> | |
34 | #include <QtDeclarative/QDeclarativeParserStatus> |
|
34 | #include <QtDeclarative/QDeclarativeParserStatus> | |
35 | #endif |
|
35 | #endif | |
36 |
|
36 | |||
37 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
37 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
38 |
|
38 | |||
39 | class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QDECLARATIVE_PARSER_STATUS |
|
39 | class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QDECLARATIVE_PARSER_STATUS | |
40 | { |
|
40 | { | |
41 | Q_OBJECT |
|
41 | Q_OBJECT | |
42 | #ifdef CHARTS_FOR_QUICK2 |
|
42 | #ifdef CHARTS_FOR_QUICK2 | |
43 | Q_INTERFACES(QQmlParserStatus) |
|
43 | Q_INTERFACES(QQmlParserStatus) | |
44 | #else |
|
44 | #else | |
45 | Q_INTERFACES(QDeclarativeParserStatus) |
|
45 | Q_INTERFACES(QDeclarativeParserStatus) | |
46 | #endif |
|
46 | #endif | |
47 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
47 | Q_PROPERTY(int count READ count NOTIFY countChanged) | |
48 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) |
|
48 | Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1) | |
49 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) |
|
49 | Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1) | |
50 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) |
|
50 | Q_PROPERTY(QAbstractAxis *axisXTop READ axisXTop WRITE setAxisXTop NOTIFY axisXTopChanged REVISION 2) | |
51 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) |
|
51 | Q_PROPERTY(QAbstractAxis *axisYRight READ axisYRight WRITE setAxisYRight NOTIFY axisYRightChanged REVISION 2) | |
52 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) |
|
52 | Q_PROPERTY(QAbstractAxis *axisAngular READ axisAngular WRITE setAxisAngular NOTIFY axisAngularChanged REVISION 3) | |
53 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) |
|
53 | Q_PROPERTY(QAbstractAxis *axisRadial READ axisRadial WRITE setAxisRadial NOTIFY axisRadialChanged REVISION 3) | |
54 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) |
|
54 | Q_PROPERTY(qreal borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged REVISION 1) | |
55 | #ifdef CHARTS_FOR_QUICK2 |
|
55 | #ifdef CHARTS_FOR_QUICK2 | |
56 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
56 | Q_PROPERTY(QQmlListProperty<QObject> declarativeChildren READ declarativeChildren) | |
57 | #else |
|
57 | #else | |
58 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) |
|
58 | Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren) | |
59 | #endif |
|
59 | #endif | |
|
60 | Q_PROPERTY(QString brushFilename READ brushFilename WRITE setBrushFilename NOTIFY brushFilenameChanged REVISION 4) | |||
|
61 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged REVISION 4) | |||
60 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") |
|
62 | Q_CLASSINFO("DefaultProperty", "declarativeChildren") | |
61 |
|
63 | |||
62 | public: |
|
64 | public: | |
63 | explicit DeclarativeScatterSeries(QObject *parent = 0); |
|
65 | explicit DeclarativeScatterSeries(QObject *parent = 0); | |
64 | QXYSeries *xySeries() { return this; } |
|
66 | QXYSeries *xySeries() { return this; } | |
65 | QAbstractAxis *axisX() { return m_axes->axisX(); } |
|
67 | QAbstractAxis *axisX() { return m_axes->axisX(); } | |
66 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
68 | void setAxisX(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
67 | QAbstractAxis *axisY() { return m_axes->axisY(); } |
|
69 | QAbstractAxis *axisY() { return m_axes->axisY(); } | |
68 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
70 | void setAxisY(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
69 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } |
|
71 | Q_REVISION(2) QAbstractAxis *axisXTop() { return m_axes->axisXTop(); } | |
70 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } |
|
72 | Q_REVISION(2) void setAxisXTop(QAbstractAxis *axis) { m_axes->setAxisXTop(axis); } | |
71 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } |
|
73 | Q_REVISION(2) QAbstractAxis *axisYRight() { return m_axes->axisYRight(); } | |
72 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } |
|
74 | Q_REVISION(2) void setAxisYRight(QAbstractAxis *axis) { m_axes->setAxisYRight(axis); } | |
73 | Q_REVISION(3) QAbstractAxis *axisAngular() { return m_axes->axisX(); } |
|
75 | Q_REVISION(3) QAbstractAxis *axisAngular() { return m_axes->axisX(); } | |
74 | Q_REVISION(3) void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } |
|
76 | Q_REVISION(3) void setAxisAngular(QAbstractAxis *axis) { m_axes->setAxisX(axis); } | |
75 | Q_REVISION(3) QAbstractAxis *axisRadial() { return m_axes->axisY(); } |
|
77 | Q_REVISION(3) QAbstractAxis *axisRadial() { return m_axes->axisY(); } | |
76 | Q_REVISION(3) void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } |
|
78 | Q_REVISION(3) void setAxisRadial(QAbstractAxis *axis) { m_axes->setAxisY(axis); } | |
77 | qreal borderWidth() const; |
|
79 | qreal borderWidth() const; | |
78 | void setBorderWidth(qreal borderWidth); |
|
80 | void setBorderWidth(qreal borderWidth); | |
79 | QDECLARATIVE_LIST_PROPERTY<QObject> declarativeChildren(); |
|
81 | QDECLARATIVE_LIST_PROPERTY<QObject> declarativeChildren(); | |
|
82 | QString brushFilename() const; | |||
|
83 | void setBrushFilename(const QString &brushFilename); | |||
|
84 | void setBrush(const QBrush &brush); | |||
|
85 | QBrush brush() const; | |||
80 |
|
86 | |||
81 | public: // from QDeclarativeParserStatus |
|
87 | public: // from QDeclarativeParserStatus | |
82 | void classBegin() { DeclarativeXySeries::classBegin(); } |
|
88 | void classBegin() { DeclarativeXySeries::classBegin(); } | |
83 | void componentComplete() { DeclarativeXySeries::componentComplete(); } |
|
89 | void componentComplete() { DeclarativeXySeries::componentComplete(); } | |
84 |
|
90 | |||
85 | public: |
|
91 | public: | |
86 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } |
|
92 | Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); } | |
87 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } |
|
93 | Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); } | |
88 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } |
|
94 | Q_REVISION(3) Q_INVOKABLE void replace(int index, qreal newX, qreal newY) { DeclarativeXySeries::replace(index, newX, newY); } | |
89 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } |
|
95 | Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); } | |
90 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } |
|
96 | Q_REVISION(3) Q_INVOKABLE void remove(int index) { DeclarativeXySeries::remove(index); } | |
91 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } |
|
97 | Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); } | |
92 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } |
|
98 | Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); } | |
93 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } |
|
99 | Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); } | |
94 |
|
100 | |||
95 | Q_SIGNALS: |
|
101 | Q_SIGNALS: | |
96 | void countChanged(int count); |
|
102 | void countChanged(int count); | |
97 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); |
|
103 | Q_REVISION(1) void axisXChanged(QAbstractAxis *axis); | |
98 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); |
|
104 | Q_REVISION(1) void axisYChanged(QAbstractAxis *axis); | |
99 | Q_REVISION(1) void borderWidthChanged(qreal width); |
|
105 | Q_REVISION(1) void borderWidthChanged(qreal width); | |
100 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); |
|
106 | Q_REVISION(2) void axisXTopChanged(QAbstractAxis *axis); | |
101 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); |
|
107 | Q_REVISION(2) void axisYRightChanged(QAbstractAxis *axis); | |
102 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); |
|
108 | Q_REVISION(3) void axisAngularChanged(QAbstractAxis *axis); | |
103 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); |
|
109 | Q_REVISION(3) void axisRadialChanged(QAbstractAxis *axis); | |
|
110 | Q_REVISION(4) void brushFilenameChanged(const QString &brushFilename); | |||
|
111 | Q_REVISION(4) void brushChanged(); | |||
104 |
|
112 | |||
105 | public Q_SLOTS: |
|
113 | public Q_SLOTS: | |
106 | static void appendDeclarativeChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); |
|
114 | static void appendDeclarativeChildren(QDECLARATIVE_LIST_PROPERTY<QObject> *list, QObject *element); | |
107 | void handleCountChanged(int index); |
|
115 | void handleCountChanged(int index); | |
108 |
|
116 | |||
|
117 | private Q_SLOTS: | |||
|
118 | void handleBrushChanged(); | |||
|
119 | ||||
109 | public: |
|
120 | public: | |
110 | DeclarativeAxes *m_axes; |
|
121 | DeclarativeAxes *m_axes; | |
|
122 | ||||
|
123 | private: | |||
|
124 | QString m_brushFilename; | |||
|
125 | QImage m_brushImage; | |||
111 | }; |
|
126 | }; | |
112 |
|
127 | |||
113 | QTCOMMERCIALCHART_END_NAMESPACE |
|
128 | QTCOMMERCIALCHART_END_NAMESPACE | |
114 |
|
129 | |||
115 | #endif // DECLARATIVESCATTERSERIES_H |
|
130 | #endif // DECLARATIVESCATTERSERIES_H |
@@ -1,252 +1,261 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qchart.h" |
|
21 | #include "qchart.h" | |
22 | #include "qabstractaxis.h" |
|
22 | #include "qabstractaxis.h" | |
23 | #include "qvalueaxis.h" |
|
23 | #include "qvalueaxis.h" | |
24 | #include "qlogvalueaxis.h" |
|
24 | #include "qlogvalueaxis.h" | |
25 | #include "declarativecategoryaxis.h" |
|
25 | #include "declarativecategoryaxis.h" | |
26 | #include "qbarcategoryaxis.h" |
|
26 | #include "qbarcategoryaxis.h" | |
27 | #include "declarativechart.h" |
|
27 | #include "declarativechart.h" | |
28 | #include "declarativepolarchart.h" |
|
28 | #include "declarativepolarchart.h" | |
29 | #include "declarativexypoint.h" |
|
29 | #include "declarativexypoint.h" | |
30 | #include "declarativelineseries.h" |
|
30 | #include "declarativelineseries.h" | |
31 | #include "declarativesplineseries.h" |
|
31 | #include "declarativesplineseries.h" | |
32 | #include "declarativeareaseries.h" |
|
32 | #include "declarativeareaseries.h" | |
33 | #include "declarativescatterseries.h" |
|
33 | #include "declarativescatterseries.h" | |
34 | #include "declarativebarseries.h" |
|
34 | #include "declarativebarseries.h" | |
35 | #include "declarativeboxplotseries.h" |
|
35 | #include "declarativeboxplotseries.h" | |
36 | #include "declarativepieseries.h" |
|
36 | #include "declarativepieseries.h" | |
37 | #include "declarativeaxes.h" |
|
37 | #include "declarativeaxes.h" | |
38 | #include "qvxymodelmapper.h" |
|
38 | #include "qvxymodelmapper.h" | |
39 | #include "qhxymodelmapper.h" |
|
39 | #include "qhxymodelmapper.h" | |
40 | #include "qhpiemodelmapper.h" |
|
40 | #include "qhpiemodelmapper.h" | |
41 | #include "qvpiemodelmapper.h" |
|
41 | #include "qvpiemodelmapper.h" | |
42 | #include "qhbarmodelmapper.h" |
|
42 | #include "qhbarmodelmapper.h" | |
43 | #include "qvbarmodelmapper.h" |
|
43 | #include "qvbarmodelmapper.h" | |
44 | #include "declarativemargins.h" |
|
44 | #include "declarativemargins.h" | |
45 | #include "qarealegendmarker.h" |
|
45 | #include "qarealegendmarker.h" | |
46 | #include "qbarlegendmarker.h" |
|
46 | #include "qbarlegendmarker.h" | |
47 | #include "qpielegendmarker.h" |
|
47 | #include "qpielegendmarker.h" | |
48 | #include "qxylegendmarker.h" |
|
48 | #include "qxylegendmarker.h" | |
49 | #ifndef QT_ON_ARM |
|
49 | #ifndef QT_ON_ARM | |
50 | #include "qdatetimeaxis.h" |
|
50 | #include "qdatetimeaxis.h" | |
51 | #endif |
|
51 | #endif | |
52 | #include "shared_defines.h" |
|
52 | #include "shared_defines.h" | |
53 | #include <QAbstractItemModel> |
|
53 | #include <QAbstractItemModel> | |
54 | #ifdef CHARTS_FOR_QUICK2 |
|
54 | #ifdef CHARTS_FOR_QUICK2 | |
55 | #include <QtQml/QQmlExtensionPlugin> |
|
55 | #include <QtQml/QQmlExtensionPlugin> | |
56 | #else |
|
56 | #else | |
57 | #include <QtDeclarative/qdeclarativeextensionplugin.h> |
|
57 | #include <QtDeclarative/qdeclarativeextensionplugin.h> | |
58 | #include <QtDeclarative/qdeclarative.h> |
|
58 | #include <QtDeclarative/qdeclarative.h> | |
59 | #endif |
|
59 | #endif | |
60 |
|
60 | |||
61 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
61 | QTCOMMERCIALCHART_USE_NAMESPACE | |
62 |
|
62 | |||
63 | Q_DECLARE_METATYPE(QList<QPieSlice *>) |
|
63 | Q_DECLARE_METATYPE(QList<QPieSlice *>) | |
64 | Q_DECLARE_METATYPE(QList<QBarSet *>) |
|
64 | Q_DECLARE_METATYPE(QList<QBarSet *>) | |
65 | Q_DECLARE_METATYPE(QList<QAbstractAxis *>) |
|
65 | Q_DECLARE_METATYPE(QList<QAbstractAxis *>) | |
66 |
|
66 | |||
67 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
67 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
68 |
|
68 | |||
69 | Q_DECLARE_METATYPE(DeclarativeChart *) |
|
69 | Q_DECLARE_METATYPE(DeclarativeChart *) | |
70 | Q_DECLARE_METATYPE(DeclarativePolarChart *) |
|
70 | Q_DECLARE_METATYPE(DeclarativePolarChart *) | |
71 | Q_DECLARE_METATYPE(DeclarativeMargins *) |
|
71 | Q_DECLARE_METATYPE(DeclarativeMargins *) | |
72 | Q_DECLARE_METATYPE(DeclarativeAreaSeries *) |
|
72 | Q_DECLARE_METATYPE(DeclarativeAreaSeries *) | |
73 | Q_DECLARE_METATYPE(DeclarativeBarSeries *) |
|
73 | Q_DECLARE_METATYPE(DeclarativeBarSeries *) | |
74 | Q_DECLARE_METATYPE(DeclarativeBarSet *) |
|
74 | Q_DECLARE_METATYPE(DeclarativeBarSet *) | |
75 | Q_DECLARE_METATYPE(DeclarativeBoxPlotSeries *) |
|
75 | Q_DECLARE_METATYPE(DeclarativeBoxPlotSeries *) | |
76 | Q_DECLARE_METATYPE(DeclarativeBoxSet *) |
|
76 | Q_DECLARE_METATYPE(DeclarativeBoxSet *) | |
77 | Q_DECLARE_METATYPE(DeclarativeLineSeries *) |
|
77 | Q_DECLARE_METATYPE(DeclarativeLineSeries *) | |
78 | Q_DECLARE_METATYPE(DeclarativePieSeries *) |
|
78 | Q_DECLARE_METATYPE(DeclarativePieSeries *) | |
|
79 | Q_DECLARE_METATYPE(DeclarativePieSlice *) | |||
79 | Q_DECLARE_METATYPE(DeclarativeScatterSeries *) |
|
80 | Q_DECLARE_METATYPE(DeclarativeScatterSeries *) | |
80 | Q_DECLARE_METATYPE(DeclarativeSplineSeries *) |
|
81 | Q_DECLARE_METATYPE(DeclarativeSplineSeries *) | |
81 |
|
82 | |||
82 | Q_DECLARE_METATYPE(QAbstractAxis *) |
|
83 | Q_DECLARE_METATYPE(QAbstractAxis *) | |
83 | Q_DECLARE_METATYPE(QValueAxis *) |
|
84 | Q_DECLARE_METATYPE(QValueAxis *) | |
84 | Q_DECLARE_METATYPE(QBarCategoryAxis *) |
|
85 | Q_DECLARE_METATYPE(QBarCategoryAxis *) | |
85 | Q_DECLARE_METATYPE(QCategoryAxis *) |
|
86 | Q_DECLARE_METATYPE(QCategoryAxis *) | |
86 | Q_DECLARE_METATYPE(QDateTimeAxis *) |
|
87 | Q_DECLARE_METATYPE(QDateTimeAxis *) | |
87 | Q_DECLARE_METATYPE(QLogValueAxis *) |
|
88 | Q_DECLARE_METATYPE(QLogValueAxis *) | |
88 |
|
89 | |||
89 | Q_DECLARE_METATYPE(QLegend *) |
|
90 | Q_DECLARE_METATYPE(QLegend *) | |
90 | Q_DECLARE_METATYPE(QLegendMarker *) |
|
91 | Q_DECLARE_METATYPE(QLegendMarker *) | |
91 | Q_DECLARE_METATYPE(QAreaLegendMarker *) |
|
92 | Q_DECLARE_METATYPE(QAreaLegendMarker *) | |
92 | Q_DECLARE_METATYPE(QBarLegendMarker *) |
|
93 | Q_DECLARE_METATYPE(QBarLegendMarker *) | |
93 | Q_DECLARE_METATYPE(QPieLegendMarker *) |
|
94 | Q_DECLARE_METATYPE(QPieLegendMarker *) | |
94 |
|
95 | |||
95 | Q_DECLARE_METATYPE(QHPieModelMapper *) |
|
96 | Q_DECLARE_METATYPE(QHPieModelMapper *) | |
96 | Q_DECLARE_METATYPE(QHXYModelMapper *) |
|
97 | Q_DECLARE_METATYPE(QHXYModelMapper *) | |
97 | Q_DECLARE_METATYPE(QPieModelMapper *) |
|
98 | Q_DECLARE_METATYPE(QPieModelMapper *) | |
98 | Q_DECLARE_METATYPE(QHBarModelMapper *) |
|
99 | Q_DECLARE_METATYPE(QHBarModelMapper *) | |
99 | Q_DECLARE_METATYPE(QBarModelMapper *) |
|
100 | Q_DECLARE_METATYPE(QBarModelMapper *) | |
100 | Q_DECLARE_METATYPE(QVBarModelMapper *) |
|
101 | Q_DECLARE_METATYPE(QVBarModelMapper *) | |
101 | Q_DECLARE_METATYPE(QVPieModelMapper *) |
|
102 | Q_DECLARE_METATYPE(QVPieModelMapper *) | |
102 | Q_DECLARE_METATYPE(QVXYModelMapper *) |
|
103 | Q_DECLARE_METATYPE(QVXYModelMapper *) | |
103 | Q_DECLARE_METATYPE(QXYLegendMarker *) |
|
104 | Q_DECLARE_METATYPE(QXYLegendMarker *) | |
104 | Q_DECLARE_METATYPE(QXYModelMapper *) |
|
105 | Q_DECLARE_METATYPE(QXYModelMapper *) | |
105 |
|
106 | |||
106 | Q_DECLARE_METATYPE(QAbstractSeries *) |
|
107 | Q_DECLARE_METATYPE(QAbstractSeries *) | |
107 | Q_DECLARE_METATYPE(QXYSeries *) |
|
108 | Q_DECLARE_METATYPE(QXYSeries *) | |
108 | Q_DECLARE_METATYPE(QAbstractBarSeries *) |
|
109 | Q_DECLARE_METATYPE(QAbstractBarSeries *) | |
109 | Q_DECLARE_METATYPE(QBarSeries *) |
|
110 | Q_DECLARE_METATYPE(QBarSeries *) | |
110 | Q_DECLARE_METATYPE(QBarSet *) |
|
111 | Q_DECLARE_METATYPE(QBarSet *) | |
111 | Q_DECLARE_METATYPE(QAreaSeries *) |
|
112 | Q_DECLARE_METATYPE(QAreaSeries *) | |
112 | Q_DECLARE_METATYPE(QHorizontalBarSeries *) |
|
113 | Q_DECLARE_METATYPE(QHorizontalBarSeries *) | |
113 | Q_DECLARE_METATYPE(QHorizontalPercentBarSeries *) |
|
114 | Q_DECLARE_METATYPE(QHorizontalPercentBarSeries *) | |
114 | Q_DECLARE_METATYPE(QHorizontalStackedBarSeries *) |
|
115 | Q_DECLARE_METATYPE(QHorizontalStackedBarSeries *) | |
115 | Q_DECLARE_METATYPE(QLineSeries *) |
|
116 | Q_DECLARE_METATYPE(QLineSeries *) | |
116 | Q_DECLARE_METATYPE(QPercentBarSeries *) |
|
117 | Q_DECLARE_METATYPE(QPercentBarSeries *) | |
117 | Q_DECLARE_METATYPE(QPieSeries *) |
|
118 | Q_DECLARE_METATYPE(QPieSeries *) | |
118 | Q_DECLARE_METATYPE(QPieSlice *) |
|
119 | Q_DECLARE_METATYPE(QPieSlice *) | |
119 | Q_DECLARE_METATYPE(QScatterSeries *) |
|
120 | Q_DECLARE_METATYPE(QScatterSeries *) | |
120 | Q_DECLARE_METATYPE(QSplineSeries *) |
|
121 | Q_DECLARE_METATYPE(QSplineSeries *) | |
121 | Q_DECLARE_METATYPE(QStackedBarSeries *) |
|
122 | Q_DECLARE_METATYPE(QStackedBarSeries *) | |
122 |
|
123 | |||
123 | #endif |
|
124 | #endif | |
124 |
|
125 | |||
125 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
126 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
126 |
|
127 | |||
127 | class ChartQmlPlugin : public QDECLARATIVE_EXTENSION_PLUGIN |
|
128 | class ChartQmlPlugin : public QDECLARATIVE_EXTENSION_PLUGIN | |
128 | { |
|
129 | { | |
129 | Q_OBJECT |
|
130 | Q_OBJECT | |
130 |
|
131 | |||
131 | #ifdef CHARTS_FOR_QUICK2 |
|
132 | #ifdef CHARTS_FOR_QUICK2 | |
132 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") |
|
133 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | |
133 | #else |
|
134 | #else | |
134 | # if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
135 | # if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
135 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface") |
|
136 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface") | |
136 | # endif |
|
137 | # endif | |
137 | #endif |
|
138 | #endif | |
138 |
|
139 | |||
139 | public: |
|
140 | public: | |
140 | virtual void registerTypes(const char *uri) |
|
141 | virtual void registerTypes(const char *uri) | |
141 | { |
|
142 | { | |
142 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); |
|
143 | Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart")); | |
143 |
|
144 | |||
144 | qRegisterMetaType<QList<QPieSlice *> >(); |
|
145 | qRegisterMetaType<QList<QPieSlice *> >(); | |
145 | qRegisterMetaType<QList<QBarSet *> >(); |
|
146 | qRegisterMetaType<QList<QBarSet *> >(); | |
146 | qRegisterMetaType<QList<QAbstractAxis *> >(); |
|
147 | qRegisterMetaType<QList<QAbstractAxis *> >(); | |
147 |
|
148 | |||
148 | // QtCommercial.Chart 1.0 |
|
149 | // QtCommercial.Chart 1.0 | |
149 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); |
|
150 | qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView"); | |
150 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); |
|
151 | qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint"); | |
151 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); |
|
152 | qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries"); | |
152 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); |
|
153 | qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries"); | |
153 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); |
|
154 | qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries"); | |
154 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); |
|
155 | qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries"); | |
155 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); |
|
156 | qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries"); | |
156 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); |
|
157 | qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries"); | |
157 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); |
|
158 | qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries"); | |
158 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); |
|
159 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries"); | |
159 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); |
|
160 | qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice"); | |
160 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); |
|
161 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet"); | |
161 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); |
|
162 | qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper"); | |
162 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); |
|
163 | qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper"); | |
163 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); |
|
164 | qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper"); | |
164 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); |
|
165 | qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper"); | |
165 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); |
|
166 | qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper"); | |
166 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); |
|
167 | qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper"); | |
167 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis"); |
|
168 | qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis"); | |
168 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis"); |
|
169 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis"); | |
169 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", |
|
170 | qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend", | |
170 | QLatin1String("Trying to create uncreatable: Legend.")); |
|
171 | QLatin1String("Trying to create uncreatable: Legend.")); | |
171 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", |
|
172 | qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries", | |
172 | QLatin1String("Trying to create uncreatable: XYSeries.")); |
|
173 | QLatin1String("Trying to create uncreatable: XYSeries.")); | |
173 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", |
|
174 | qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel", | |
174 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); |
|
175 | QLatin1String("Trying to create uncreatable: AbstractItemModel.")); | |
175 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", |
|
176 | qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper", | |
176 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); |
|
177 | QLatin1String("Trying to create uncreatable: XYModelMapper.")); | |
177 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", |
|
178 | qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper", | |
178 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); |
|
179 | QLatin1String("Trying to create uncreatable: PieModelMapper.")); | |
179 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", |
|
180 | qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper", | |
180 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); |
|
181 | QLatin1String("Trying to create uncreatable: BarModelMapper.")); | |
181 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", |
|
182 | qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries", | |
182 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); |
|
183 | QLatin1String("Trying to create uncreatable: AbstractSeries.")); | |
183 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries", |
|
184 | qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries", | |
184 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); |
|
185 | QLatin1String("Trying to create uncreatable: AbstractBarSeries.")); | |
185 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis", |
|
186 | qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis", | |
186 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); |
|
187 | QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead.")); | |
187 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase", |
|
188 | qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase", | |
188 | QLatin1String("Trying to create uncreatable: BarsetBase.")); |
|
189 | QLatin1String("Trying to create uncreatable: BarsetBase.")); | |
189 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", |
|
190 | qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries", | |
190 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); |
|
191 | QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead.")); | |
191 | qmlRegisterUncreatableType<DeclarativeAxes>(uri, 1, 0, "DeclarativeAxes", |
|
192 | qmlRegisterUncreatableType<DeclarativeAxes>(uri, 1, 0, "DeclarativeAxes", | |
192 | QLatin1String("Trying to create uncreatable: DeclarativeAxes.")); |
|
193 | QLatin1String("Trying to create uncreatable: DeclarativeAxes.")); | |
193 |
|
194 | |||
194 | // QtCommercial.Chart 1.1 |
|
195 | // QtCommercial.Chart 1.1 | |
195 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView"); |
|
196 | qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView"); | |
196 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries"); |
|
197 | qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries"); | |
197 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries"); |
|
198 | qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries"); | |
198 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries"); |
|
199 | qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries"); | |
199 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries"); |
|
200 | qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries"); | |
200 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries"); |
|
201 | qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries"); | |
201 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries"); |
|
202 | qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries"); | |
202 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries"); |
|
203 | qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries"); | |
203 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries"); |
|
204 | qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries"); | |
204 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries"); |
|
205 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries"); | |
205 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries"); |
|
206 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries"); | |
206 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries"); |
|
207 | qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries"); | |
207 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet"); |
|
208 | qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet"); | |
208 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis"); |
|
209 | qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis"); | |
209 | #ifndef QT_ON_ARM |
|
210 | #ifndef QT_ON_ARM | |
210 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis"); |
|
211 | qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis"); | |
211 | #endif |
|
212 | #endif | |
212 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis"); |
|
213 | qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis"); | |
213 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange"); |
|
214 | qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange"); | |
214 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis"); |
|
215 | qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis"); | |
215 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins", |
|
216 | qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins", | |
216 | QLatin1String("Trying to create uncreatable: Margins.")); |
|
217 | QLatin1String("Trying to create uncreatable: Margins.")); | |
217 |
|
218 | |||
218 | // QtCommercial.Chart 1.2 |
|
219 | // QtCommercial.Chart 1.2 | |
219 | qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView"); |
|
220 | qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView"); | |
220 | qmlRegisterType<DeclarativeScatterSeries, 2>(uri, 1, 2, "ScatterSeries"); |
|
221 | qmlRegisterType<DeclarativeScatterSeries, 2>(uri, 1, 2, "ScatterSeries"); | |
221 | qmlRegisterType<DeclarativeLineSeries, 2>(uri, 1, 2, "LineSeries"); |
|
222 | qmlRegisterType<DeclarativeLineSeries, 2>(uri, 1, 2, "LineSeries"); | |
222 | qmlRegisterType<DeclarativeSplineSeries, 2>(uri, 1, 2, "SplineSeries"); |
|
223 | qmlRegisterType<DeclarativeSplineSeries, 2>(uri, 1, 2, "SplineSeries"); | |
223 | qmlRegisterType<DeclarativeAreaSeries, 2>(uri, 1, 2, "AreaSeries"); |
|
224 | qmlRegisterType<DeclarativeAreaSeries, 2>(uri, 1, 2, "AreaSeries"); | |
224 | qmlRegisterType<DeclarativeBarSeries, 2>(uri, 1, 2, "BarSeries"); |
|
225 | qmlRegisterType<DeclarativeBarSeries, 2>(uri, 1, 2, "BarSeries"); | |
225 | qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 1, 2, "StackedBarSeries"); |
|
226 | qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 1, 2, "StackedBarSeries"); | |
226 | qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 1, 2, "PercentBarSeries"); |
|
227 | qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 1, 2, "PercentBarSeries"); | |
227 | qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 1, 2, "HorizontalBarSeries"); |
|
228 | qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 1, 2, "HorizontalBarSeries"); | |
228 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 1, 2, "HorizontalStackedBarSeries"); |
|
229 | qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 1, 2, "HorizontalStackedBarSeries"); | |
229 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 1, 2, "HorizontalPercentBarSeries"); |
|
230 | qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 1, 2, "HorizontalPercentBarSeries"); | |
230 |
|
231 | |||
231 | // QtCommercial.Chart 1.3 |
|
232 | // QtCommercial.Chart 1.3 | |
232 | qmlRegisterType<DeclarativeChart, 3>(uri, 1, 3, "ChartView"); |
|
233 | qmlRegisterType<DeclarativeChart, 3>(uri, 1, 3, "ChartView"); | |
233 | qmlRegisterType<DeclarativePolarChart, 1>(uri, 1, 3, "PolarChartView"); |
|
234 | qmlRegisterType<DeclarativePolarChart, 1>(uri, 1, 3, "PolarChartView"); | |
234 | qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 1, 3, "SplineSeries"); |
|
235 | qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 1, 3, "SplineSeries"); | |
235 | qmlRegisterType<DeclarativeScatterSeries, 3>(uri, 1, 3, "ScatterSeries"); |
|
236 | qmlRegisterType<DeclarativeScatterSeries, 3>(uri, 1, 3, "ScatterSeries"); | |
236 | qmlRegisterType<DeclarativeLineSeries, 3>(uri, 1, 3, "LineSeries"); |
|
237 | qmlRegisterType<DeclarativeLineSeries, 3>(uri, 1, 3, "LineSeries"); | |
237 | qmlRegisterType<DeclarativeAreaSeries, 3>(uri, 1, 3, "AreaSeries"); |
|
238 | qmlRegisterType<DeclarativeAreaSeries, 3>(uri, 1, 3, "AreaSeries"); | |
238 | qmlRegisterType<QLogValueAxis>(uri, 1, 3, "LogValueAxis"); |
|
239 | qmlRegisterType<QLogValueAxis>(uri, 1, 3, "LogValueAxis"); | |
239 | qmlRegisterType<DeclarativeBoxPlotSeries>(uri, 1, 3, "BoxPlotSeries"); |
|
240 | qmlRegisterType<DeclarativeBoxPlotSeries>(uri, 1, 3, "BoxPlotSeries"); | |
240 | qmlRegisterType<DeclarativeBoxSet>(uri, 1, 3, "BoxSet"); |
|
241 | qmlRegisterType<DeclarativeBoxSet>(uri, 1, 3, "BoxSet"); | |
|
242 | ||||
|
243 | // QtCommercial.Chart 1.4 | |||
|
244 | qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 1, 4, "AreaSeries"); | |||
|
245 | qmlRegisterType<DeclarativeBarSet, 2>(uri, 1, 4, "BarSet"); | |||
|
246 | qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 1, 4, "BoxPlotSeries"); | |||
|
247 | qmlRegisterType<DeclarativeBoxSet, 1>(uri, 1, 4, "BoxSet"); | |||
|
248 | qmlRegisterType<DeclarativePieSlice>(uri, 1, 4, "PieSlice"); | |||
|
249 | qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 1, 4, "ScatterSeries"); | |||
241 | } |
|
250 | } | |
242 | }; |
|
251 | }; | |
243 |
|
252 | |||
244 | QTCOMMERCIALCHART_END_NAMESPACE |
|
253 | QTCOMMERCIALCHART_END_NAMESPACE | |
245 |
|
254 | |||
246 | #include "plugin.moc" |
|
255 | #include "plugin.moc" | |
247 |
|
256 | |||
248 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
257 | QTCOMMERCIALCHART_USE_NAMESPACE | |
249 |
|
258 | |||
250 | #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) |
|
259 | #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) | |
251 | Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) |
|
260 | Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin)) | |
252 | #endif |
|
261 | #endif |
@@ -1,2124 +1,2170 | |||||
1 | import QtQuick.tooling 1.1 |
|
1 | import QtQuick.tooling 1.1 | |
2 |
|
2 | |||
3 | // This file describes the plugin-supplied types contained in the library. |
|
3 | // This file describes the plugin-supplied types contained in the library. | |
4 | // It is used for QML tooling purposes only. |
|
4 | // It is used for QML tooling purposes only. | |
|
5 | // | |||
|
6 | // This file was auto-generated by: | |||
|
7 | // 'qmlplugindump -nonrelocatable QtCommercial.Chart 1.4' | |||
5 |
|
8 | |||
6 | Module { |
|
9 | Module { | |
7 | Component { |
|
10 | Component { | |
8 | name: "QGraphicsObject" |
|
11 | name: "QGraphicsObject" | |
9 | defaultProperty: "children" |
|
12 | defaultProperty: "children" | |
10 | prototype: "QObject" |
|
13 | prototype: "QObject" | |
11 | Property { name: "parent"; type: "QGraphicsObject"; isPointer: true } |
|
14 | Property { name: "parent"; type: "QGraphicsObject"; isPointer: true } | |
12 | Property { name: "opacity"; type: "double" } |
|
15 | Property { name: "opacity"; type: "double" } | |
13 | Property { name: "enabled"; type: "bool" } |
|
16 | Property { name: "enabled"; type: "bool" } | |
14 | Property { name: "visible"; type: "bool" } |
|
17 | Property { name: "visible"; type: "bool" } | |
15 | Property { name: "pos"; type: "QPointF" } |
|
18 | Property { name: "pos"; type: "QPointF" } | |
16 | Property { name: "x"; type: "double" } |
|
19 | Property { name: "x"; type: "double" } | |
17 | Property { name: "y"; type: "double" } |
|
20 | Property { name: "y"; type: "double" } | |
18 | Property { name: "z"; type: "double" } |
|
21 | Property { name: "z"; type: "double" } | |
19 | Property { name: "rotation"; type: "double" } |
|
22 | Property { name: "rotation"; type: "double" } | |
20 | Property { name: "scale"; type: "double" } |
|
23 | Property { name: "scale"; type: "double" } | |
21 | Property { name: "transformOriginPoint"; type: "QPointF" } |
|
24 | Property { name: "transformOriginPoint"; type: "QPointF" } | |
22 | Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true } |
|
25 | Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true } | |
23 | Property { |
|
26 | Property { | |
24 | name: "children" |
|
27 | name: "children" | |
25 | type: "QDeclarativeListProperty<QGraphicsObject>" |
|
28 | type: "QDeclarativeListProperty<QGraphicsObject>" | |
26 | isReadonly: true |
|
29 | isReadonly: true | |
27 | } |
|
30 | } | |
28 | Property { name: "width"; type: "double" } |
|
31 | Property { name: "width"; type: "double" } | |
29 | Property { name: "height"; type: "double" } |
|
32 | Property { name: "height"; type: "double" } | |
30 | } |
|
33 | } | |
31 | Component { |
|
34 | Component { | |
32 | name: "QGraphicsWidget" |
|
35 | name: "QGraphicsWidget" | |
33 | defaultProperty: "children" |
|
36 | defaultProperty: "children" | |
34 | prototype: "QGraphicsObject" |
|
37 | prototype: "QGraphicsObject" | |
35 | Property { name: "palette"; type: "QPalette" } |
|
38 | Property { name: "palette"; type: "QPalette" } | |
36 | Property { name: "font"; type: "QFont" } |
|
39 | Property { name: "font"; type: "QFont" } | |
37 | Property { name: "layoutDirection"; type: "Qt::LayoutDirection" } |
|
40 | Property { name: "layoutDirection"; type: "Qt::LayoutDirection" } | |
38 | Property { name: "size"; type: "QSizeF" } |
|
41 | Property { name: "size"; type: "QSizeF" } | |
39 | Property { name: "minimumSize"; type: "QSizeF" } |
|
42 | Property { name: "minimumSize"; type: "QSizeF" } | |
40 | Property { name: "preferredSize"; type: "QSizeF" } |
|
43 | Property { name: "preferredSize"; type: "QSizeF" } | |
41 | Property { name: "maximumSize"; type: "QSizeF" } |
|
44 | Property { name: "maximumSize"; type: "QSizeF" } | |
42 | Property { name: "sizePolicy"; type: "QSizePolicy" } |
|
45 | Property { name: "sizePolicy"; type: "QSizePolicy" } | |
43 | Property { name: "focusPolicy"; type: "Qt::FocusPolicy" } |
|
46 | Property { name: "focusPolicy"; type: "Qt::FocusPolicy" } | |
44 | Property { name: "windowFlags"; type: "Qt::WindowFlags" } |
|
47 | Property { name: "windowFlags"; type: "Qt::WindowFlags" } | |
45 | Property { name: "windowTitle"; type: "string" } |
|
48 | Property { name: "windowTitle"; type: "string" } | |
46 | Property { name: "geometry"; type: "QRectF" } |
|
49 | Property { name: "geometry"; type: "QRectF" } | |
47 | Property { name: "autoFillBackground"; type: "bool" } |
|
50 | Property { name: "autoFillBackground"; type: "bool" } | |
48 | Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true } |
|
51 | Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true } | |
49 | Method { name: "close"; type: "bool" } |
|
52 | Method { name: "close"; type: "bool" } | |
50 | } |
|
53 | } | |
51 | Component { |
|
54 | Component { | |
52 | name: "QtCommercialChart::DeclarativeAreaSeries" |
|
55 | name: "QtCommercialChart::DeclarativeAreaSeries" | |
53 | prototype: "QtCommercialChart::QAreaSeries" |
|
56 | prototype: "QtCommercialChart::QAreaSeries" | |
54 | exports: [ |
|
57 | exports: [ | |
55 | "QtCommercial.Chart/AreaSeries 1.0", |
|
58 | "QtCommercial.Chart/AreaSeries 1.0", | |
56 | "QtCommercial.Chart/AreaSeries 1.1", |
|
59 | "QtCommercial.Chart/AreaSeries 1.1", | |
57 | "QtCommercial.Chart/AreaSeries 1.2", |
|
60 | "QtCommercial.Chart/AreaSeries 1.2", | |
58 | "QtCommercial.Chart/AreaSeries 1.3" |
|
61 | "QtCommercial.Chart/AreaSeries 1.3", | |
|
62 | "QtCommercial.Chart/AreaSeries 1.4" | |||
59 | ] |
|
63 | ] | |
60 | exportMetaObjectRevisions: [0, 1, 2, 3] |
|
64 | exportMetaObjectRevisions: [0, 1, 2, 3, 4] | |
61 | Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true } |
|
65 | Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true } | |
62 | Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true } |
|
66 | Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true } | |
63 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
67 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
64 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
68 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
65 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
69 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
66 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
70 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
67 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
71 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
68 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
72 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
69 | Property { name: "borderWidth"; revision: 1; type: "double" } |
|
73 | Property { name: "borderWidth"; revision: 1; type: "double" } | |
|
74 | Property { name: "brushFilename"; revision: 4; type: "string" } | |||
|
75 | Property { name: "brush"; revision: 4; type: "QBrush" } | |||
70 | Signal { |
|
76 | Signal { | |
71 | name: "axisXChanged" |
|
77 | name: "axisXChanged" | |
72 | revision: 1 |
|
78 | revision: 1 | |
73 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
79 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
74 | } |
|
80 | } | |
75 | Signal { |
|
81 | Signal { | |
76 | name: "axisYChanged" |
|
82 | name: "axisYChanged" | |
77 | revision: 1 |
|
83 | revision: 1 | |
78 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
84 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
79 | } |
|
85 | } | |
80 | Signal { |
|
86 | Signal { | |
81 | name: "borderWidthChanged" |
|
87 | name: "borderWidthChanged" | |
82 | revision: 1 |
|
88 | revision: 1 | |
83 | Parameter { name: "width"; type: "double" } |
|
89 | Parameter { name: "width"; type: "double" } | |
84 | } |
|
90 | } | |
85 | Signal { |
|
91 | Signal { | |
86 | name: "axisXTopChanged" |
|
92 | name: "axisXTopChanged" | |
87 | revision: 2 |
|
93 | revision: 2 | |
88 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
94 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
89 | } |
|
95 | } | |
90 | Signal { |
|
96 | Signal { | |
91 | name: "axisYRightChanged" |
|
97 | name: "axisYRightChanged" | |
92 | revision: 2 |
|
98 | revision: 2 | |
93 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
99 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
94 | } |
|
100 | } | |
95 | Signal { |
|
101 | Signal { | |
96 | name: "axisAngularChanged" |
|
102 | name: "axisAngularChanged" | |
97 | revision: 3 |
|
103 | revision: 3 | |
98 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
104 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
99 | } |
|
105 | } | |
100 | Signal { |
|
106 | Signal { | |
101 | name: "axisRadialChanged" |
|
107 | name: "axisRadialChanged" | |
102 | revision: 3 |
|
108 | revision: 3 | |
103 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
109 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
104 | } |
|
110 | } | |
|
111 | Signal { name: "brushChanged"; revision: 4 } | |||
|
112 | Signal { | |||
|
113 | name: "brushFilenameChanged" | |||
|
114 | revision: 4 | |||
|
115 | Parameter { name: "brushFilename"; type: "string" } | |||
|
116 | } | |||
105 | } |
|
117 | } | |
106 | Component { |
|
118 | Component { | |
107 | name: "QtCommercialChart::DeclarativeAxes" |
|
119 | name: "QtCommercialChart::DeclarativeAxes" | |
108 | prototype: "QObject" |
|
120 | prototype: "QObject" | |
109 | exports: ["QtCommercial.Chart/DeclarativeAxes 1.0"] |
|
121 | exports: ["QtCommercial.Chart/DeclarativeAxes 1.0"] | |
110 | isCreatable: false |
|
|||
111 | exportMetaObjectRevisions: [0] |
|
122 | exportMetaObjectRevisions: [0] | |
112 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
123 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
113 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } |
|
124 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } | |
114 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } |
|
125 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } | |
115 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } |
|
126 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } | |
116 | Signal { |
|
127 | Signal { | |
117 | name: "axisXChanged" |
|
128 | name: "axisXChanged" | |
118 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
129 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
119 | } |
|
130 | } | |
120 | Signal { |
|
131 | Signal { | |
121 | name: "axisYChanged" |
|
132 | name: "axisYChanged" | |
122 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
133 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
123 | } |
|
134 | } | |
124 | Signal { |
|
135 | Signal { | |
125 | name: "axisXTopChanged" |
|
136 | name: "axisXTopChanged" | |
126 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
137 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
127 | } |
|
138 | } | |
128 | Signal { |
|
139 | Signal { | |
129 | name: "axisYRightChanged" |
|
140 | name: "axisYRightChanged" | |
130 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
141 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
131 | } |
|
142 | } | |
132 | } |
|
143 | } | |
133 | Component { |
|
144 | Component { | |
134 | name: "QtCommercialChart::DeclarativeBarSeries" |
|
145 | name: "QtCommercialChart::DeclarativeBarSeries" | |
135 | defaultProperty: "seriesChildren" |
|
146 | defaultProperty: "seriesChildren" | |
136 | prototype: "QtCommercialChart::QBarSeries" |
|
147 | prototype: "QtCommercialChart::QBarSeries" | |
137 | exports: [ |
|
148 | exports: [ | |
138 | "QtCommercial.Chart/BarSeries 1.0", |
|
149 | "QtCommercial.Chart/BarSeries 1.0", | |
139 | "QtCommercial.Chart/BarSeries 1.1", |
|
150 | "QtCommercial.Chart/BarSeries 1.1", | |
140 | "QtCommercial.Chart/BarSeries 1.2" |
|
151 | "QtCommercial.Chart/BarSeries 1.2" | |
141 | ] |
|
152 | ] | |
142 | exportMetaObjectRevisions: [0, 1, 2] |
|
153 | exportMetaObjectRevisions: [0, 1, 2] | |
143 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
154 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
144 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
155 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
145 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
156 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
146 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
157 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
147 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
158 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
148 | Signal { |
|
159 | Signal { | |
149 | name: "axisXChanged" |
|
160 | name: "axisXChanged" | |
150 | revision: 1 |
|
161 | revision: 1 | |
151 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
162 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
152 | } |
|
163 | } | |
153 | Signal { |
|
164 | Signal { | |
154 | name: "axisYChanged" |
|
165 | name: "axisYChanged" | |
155 | revision: 1 |
|
166 | revision: 1 | |
156 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
167 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
157 | } |
|
168 | } | |
158 | Signal { |
|
169 | Signal { | |
159 | name: "axisXTopChanged" |
|
170 | name: "axisXTopChanged" | |
160 | revision: 2 |
|
171 | revision: 2 | |
161 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
172 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
162 | } |
|
173 | } | |
163 | Signal { |
|
174 | Signal { | |
164 | name: "axisYRightChanged" |
|
175 | name: "axisYRightChanged" | |
165 | revision: 2 |
|
176 | revision: 2 | |
166 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
177 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
167 | } |
|
178 | } | |
168 | Method { |
|
179 | Method { | |
169 | name: "appendSeriesChildren" |
|
180 | name: "appendSeriesChildren" | |
170 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
181 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
171 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
182 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
172 | } |
|
183 | } | |
173 | Method { |
|
184 | Method { | |
174 | name: "at" |
|
185 | name: "at" | |
175 | type: "DeclarativeBarSet*" |
|
186 | type: "DeclarativeBarSet*" | |
176 | Parameter { name: "index"; type: "int" } |
|
187 | Parameter { name: "index"; type: "int" } | |
177 | } |
|
188 | } | |
178 | Method { |
|
189 | Method { | |
179 | name: "append" |
|
190 | name: "append" | |
180 | type: "DeclarativeBarSet*" |
|
191 | type: "DeclarativeBarSet*" | |
181 | Parameter { name: "label"; type: "string" } |
|
192 | Parameter { name: "label"; type: "string" } | |
182 | Parameter { name: "values"; type: "QVariantList" } |
|
193 | Parameter { name: "values"; type: "QVariantList" } | |
183 | } |
|
194 | } | |
184 | Method { |
|
195 | Method { | |
185 | name: "insert" |
|
196 | name: "insert" | |
186 | type: "DeclarativeBarSet*" |
|
197 | type: "DeclarativeBarSet*" | |
187 | Parameter { name: "index"; type: "int" } |
|
198 | Parameter { name: "index"; type: "int" } | |
188 | Parameter { name: "label"; type: "string" } |
|
199 | Parameter { name: "label"; type: "string" } | |
189 | Parameter { name: "values"; type: "QVariantList" } |
|
200 | Parameter { name: "values"; type: "QVariantList" } | |
190 | } |
|
201 | } | |
191 | Method { |
|
202 | Method { | |
192 | name: "remove" |
|
203 | name: "remove" | |
193 | type: "bool" |
|
204 | type: "bool" | |
194 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
205 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
195 | } |
|
206 | } | |
196 | Method { name: "clear" } |
|
207 | Method { name: "clear" } | |
197 | } |
|
208 | } | |
198 | Component { |
|
209 | Component { | |
199 | name: "QtCommercialChart::DeclarativeBarSet" |
|
210 | name: "QtCommercialChart::DeclarativeBarSet" | |
200 | prototype: "QtCommercialChart::QBarSet" |
|
211 | prototype: "QtCommercialChart::QBarSet" | |
201 | exports: [ |
|
212 | exports: [ | |
202 | "QtCommercial.Chart/BarSet 1.0", |
|
213 | "QtCommercial.Chart/BarSet 1.0", | |
203 | "QtCommercial.Chart/BarSet 1.1" |
|
214 | "QtCommercial.Chart/BarSet 1.1", | |
|
215 | "QtCommercial.Chart/BarSet 1.4" | |||
204 | ] |
|
216 | ] | |
205 | exportMetaObjectRevisions: [0, 0] |
|
217 | exportMetaObjectRevisions: [0, 0, 2] | |
206 | Property { name: "values"; type: "QVariantList" } |
|
218 | Property { name: "values"; type: "QVariantList" } | |
207 | Property { name: "borderWidth"; revision: 1; type: "double" } |
|
219 | Property { name: "borderWidth"; revision: 1; type: "double" } | |
208 | Property { name: "count"; type: "int"; isReadonly: true } |
|
220 | Property { name: "count"; type: "int"; isReadonly: true } | |
|
221 | Property { name: "brushFilename"; revision: 2; type: "string" } | |||
209 | Signal { |
|
222 | Signal { | |
210 | name: "countChanged" |
|
223 | name: "countChanged" | |
211 | Parameter { name: "count"; type: "int" } |
|
224 | Parameter { name: "count"; type: "int" } | |
212 | } |
|
225 | } | |
213 | Signal { |
|
226 | Signal { | |
214 | name: "borderWidthChanged" |
|
227 | name: "borderWidthChanged" | |
215 | revision: 1 |
|
228 | revision: 1 | |
216 | Parameter { name: "width"; type: "double" } |
|
229 | Parameter { name: "width"; type: "double" } | |
217 | } |
|
230 | } | |
|
231 | Signal { | |||
|
232 | name: "brushFilenameChanged" | |||
|
233 | revision: 2 | |||
|
234 | Parameter { name: "brushFilename"; type: "string" } | |||
|
235 | } | |||
218 | Method { |
|
236 | Method { | |
219 | name: "append" |
|
237 | name: "append" | |
220 | Parameter { name: "value"; type: "double" } |
|
238 | Parameter { name: "value"; type: "double" } | |
221 | } |
|
239 | } | |
222 | Method { |
|
240 | Method { | |
223 | name: "remove" |
|
241 | name: "remove" | |
224 | Parameter { name: "index"; type: "int" } |
|
242 | Parameter { name: "index"; type: "int" } | |
225 | Parameter { name: "count"; type: "int" } |
|
243 | Parameter { name: "count"; type: "int" } | |
226 | } |
|
244 | } | |
227 | Method { |
|
245 | Method { | |
228 | name: "remove" |
|
246 | name: "remove" | |
229 | Parameter { name: "index"; type: "int" } |
|
247 | Parameter { name: "index"; type: "int" } | |
230 | } |
|
248 | } | |
231 | Method { |
|
249 | Method { | |
232 | name: "replace" |
|
250 | name: "replace" | |
233 | Parameter { name: "index"; type: "int" } |
|
251 | Parameter { name: "index"; type: "int" } | |
234 | Parameter { name: "value"; type: "double" } |
|
252 | Parameter { name: "value"; type: "double" } | |
235 | } |
|
253 | } | |
236 | Method { |
|
254 | Method { | |
237 | name: "at" |
|
255 | name: "at" | |
238 | type: "double" |
|
256 | type: "double" | |
239 | Parameter { name: "index"; type: "int" } |
|
257 | Parameter { name: "index"; type: "int" } | |
240 | } |
|
258 | } | |
241 | } |
|
259 | } | |
242 | Component { |
|
260 | Component { | |
243 | name: "QtCommercialChart::DeclarativeBoxPlotSeries" |
|
261 | name: "QtCommercialChart::DeclarativeBoxPlotSeries" | |
244 | defaultProperty: "seriesChildren" |
|
262 | defaultProperty: "seriesChildren" | |
245 | prototype: "QtCommercialChart::QBoxPlotSeries" |
|
263 | prototype: "QtCommercialChart::QBoxPlotSeries" | |
246 | exports: ["QtCommercial.Chart/BoxPlotSeries 1.3"] |
|
264 | exports: [ | |
247 | exportMetaObjectRevisions: [0] |
|
265 | "QtCommercial.Chart/BoxPlotSeries 1.3", | |
|
266 | "QtCommercial.Chart/BoxPlotSeries 1.4" | |||
|
267 | ] | |||
|
268 | exportMetaObjectRevisions: [0, 1] | |||
248 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
269 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
249 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } |
|
270 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } | |
250 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } |
|
271 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } | |
251 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } |
|
272 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } | |
252 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
273 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
|
274 | Property { name: "brushFilename"; revision: 1; type: "string" } | |||
253 | Signal { |
|
275 | Signal { | |
254 | name: "axisXChanged" |
|
276 | name: "axisXChanged" | |
255 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
277 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
256 | } |
|
278 | } | |
257 | Signal { |
|
279 | Signal { | |
258 | name: "axisYChanged" |
|
280 | name: "axisYChanged" | |
259 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
281 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
260 | } |
|
282 | } | |
261 | Signal { |
|
283 | Signal { | |
262 | name: "axisXTopChanged" |
|
284 | name: "axisXTopChanged" | |
263 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
285 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
264 | } |
|
286 | } | |
265 | Signal { |
|
287 | Signal { | |
266 | name: "axisYRightChanged" |
|
288 | name: "axisYRightChanged" | |
267 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
289 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
268 | } |
|
290 | } | |
269 | Signal { |
|
291 | Signal { | |
270 | name: "clicked" |
|
292 | name: "clicked" | |
271 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
293 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
272 | } |
|
294 | } | |
273 | Signal { |
|
295 | Signal { | |
274 | name: "hovered" |
|
296 | name: "hovered" | |
275 | Parameter { name: "status"; type: "bool" } |
|
297 | Parameter { name: "status"; type: "bool" } | |
276 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
298 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
277 | } |
|
299 | } | |
|
300 | Signal { | |||
|
301 | name: "brushFilenameChanged" | |||
|
302 | revision: 1 | |||
|
303 | Parameter { name: "brushFilename"; type: "string" } | |||
|
304 | } | |||
278 | Method { |
|
305 | Method { | |
279 | name: "appendSeriesChildren" |
|
306 | name: "appendSeriesChildren" | |
280 | Parameter { name: "list"; type: "QDECLARATIVE_LIST_PROPERTY<QObject>"; isPointer: true } |
|
307 | Parameter { name: "list"; type: "QDECLARATIVE_LIST_PROPERTY<QObject>"; isPointer: true } | |
281 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
308 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
282 | } |
|
309 | } | |
283 | Method { |
|
310 | Method { | |
284 | name: "onHovered" |
|
311 | name: "onHovered" | |
285 | Parameter { name: "status"; type: "bool" } |
|
312 | Parameter { name: "status"; type: "bool" } | |
286 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
313 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
287 | } |
|
314 | } | |
288 | Method { |
|
315 | Method { | |
289 | name: "onClicked" |
|
316 | name: "onClicked" | |
290 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
317 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
291 | } |
|
318 | } | |
292 | Method { |
|
319 | Method { | |
293 | name: "at" |
|
320 | name: "at" | |
294 | type: "DeclarativeBoxSet*" |
|
321 | type: "DeclarativeBoxSet*" | |
295 | Parameter { name: "index"; type: "int" } |
|
322 | Parameter { name: "index"; type: "int" } | |
296 | } |
|
323 | } | |
297 | Method { |
|
324 | Method { | |
298 | name: "append" |
|
325 | name: "append" | |
299 | type: "DeclarativeBoxSet*" |
|
326 | type: "DeclarativeBoxSet*" | |
300 | Parameter { name: "label"; type: "string" } |
|
327 | Parameter { name: "label"; type: "string" } | |
301 | Parameter { name: "values"; type: "QVariantList" } |
|
328 | Parameter { name: "values"; type: "QVariantList" } | |
302 | } |
|
329 | } | |
303 | Method { |
|
330 | Method { | |
304 | name: "append" |
|
331 | name: "append" | |
305 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } |
|
332 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } | |
306 | } |
|
333 | } | |
307 | Method { |
|
334 | Method { | |
308 | name: "insert" |
|
335 | name: "insert" | |
309 | type: "DeclarativeBoxSet*" |
|
336 | type: "DeclarativeBoxSet*" | |
310 | Parameter { name: "index"; type: "int" } |
|
337 | Parameter { name: "index"; type: "int" } | |
311 | Parameter { name: "label"; type: "string" } |
|
338 | Parameter { name: "label"; type: "string" } | |
312 | Parameter { name: "values"; type: "QVariantList" } |
|
339 | Parameter { name: "values"; type: "QVariantList" } | |
313 | } |
|
340 | } | |
314 | Method { |
|
341 | Method { | |
315 | name: "remove" |
|
342 | name: "remove" | |
316 | type: "bool" |
|
343 | type: "bool" | |
317 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } |
|
344 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } | |
318 | } |
|
345 | } | |
319 | Method { name: "clear" } |
|
346 | Method { name: "clear" } | |
320 | } |
|
347 | } | |
321 | Component { |
|
348 | Component { | |
322 | name: "QtCommercialChart::DeclarativeBoxSet" |
|
349 | name: "QtCommercialChart::DeclarativeBoxSet" | |
323 | prototype: "QtCommercialChart::QBoxSet" |
|
350 | prototype: "QtCommercialChart::QBoxSet" | |
324 | exports: ["QtCommercial.Chart/BoxSet 1.3"] |
|
351 | exports: [ | |
325 | exportMetaObjectRevisions: [0] |
|
352 | "QtCommercial.Chart/BoxSet 1.3", | |
|
353 | "QtCommercial.Chart/BoxSet 1.4" | |||
|
354 | ] | |||
|
355 | exportMetaObjectRevisions: [0, 1] | |||
326 | Enum { |
|
356 | Enum { | |
327 | name: "ValuePositions" |
|
357 | name: "ValuePositions" | |
328 | values: { |
|
358 | values: { | |
329 | "LowerExtreme": 0, |
|
359 | "LowerExtreme": 0, | |
330 | "LowerQuartile": 1, |
|
360 | "LowerQuartile": 1, | |
331 | "Median": 2, |
|
361 | "Median": 2, | |
332 | "UpperQuartile": 3, |
|
362 | "UpperQuartile": 3, | |
333 | "UpperExtreme": 4 |
|
363 | "UpperExtreme": 4 | |
334 | } |
|
364 | } | |
335 | } |
|
365 | } | |
336 | Property { name: "values"; type: "QVariantList" } |
|
366 | Property { name: "values"; type: "QVariantList" } | |
337 | Property { name: "label"; type: "string" } |
|
367 | Property { name: "label"; type: "string" } | |
338 | Property { name: "count"; type: "int"; isReadonly: true } |
|
368 | Property { name: "count"; type: "int"; isReadonly: true } | |
|
369 | Property { name: "brushFilename"; revision: 1; type: "string" } | |||
339 | Signal { name: "changedValues" } |
|
370 | Signal { name: "changedValues" } | |
340 | Signal { |
|
371 | Signal { | |
341 | name: "changedValue" |
|
372 | name: "changedValue" | |
342 | Parameter { name: "index"; type: "int" } |
|
373 | Parameter { name: "index"; type: "int" } | |
343 | } |
|
374 | } | |
|
375 | Signal { | |||
|
376 | name: "brushFilenameChanged" | |||
|
377 | revision: 1 | |||
|
378 | Parameter { name: "brushFilename"; type: "string" } | |||
|
379 | } | |||
344 | Method { |
|
380 | Method { | |
345 | name: "append" |
|
381 | name: "append" | |
346 | Parameter { name: "value"; type: "double" } |
|
382 | Parameter { name: "value"; type: "double" } | |
347 | } |
|
383 | } | |
348 | Method { name: "clear" } |
|
384 | Method { name: "clear" } | |
349 | Method { |
|
385 | Method { | |
350 | name: "at" |
|
386 | name: "at" | |
351 | type: "double" |
|
387 | type: "double" | |
352 | Parameter { name: "index"; type: "int" } |
|
388 | Parameter { name: "index"; type: "int" } | |
353 | } |
|
389 | } | |
354 | Method { |
|
390 | Method { | |
355 | name: "setValue" |
|
391 | name: "setValue" | |
356 | Parameter { name: "index"; type: "int" } |
|
392 | Parameter { name: "index"; type: "int" } | |
357 | Parameter { name: "value"; type: "double" } |
|
393 | Parameter { name: "value"; type: "double" } | |
358 | } |
|
394 | } | |
359 | } |
|
395 | } | |
360 | Component { |
|
396 | Component { | |
361 | name: "QtCommercialChart::DeclarativeCategoryAxis" |
|
397 | name: "QtCommercialChart::DeclarativeCategoryAxis" | |
362 | defaultProperty: "axisChildren" |
|
398 | defaultProperty: "axisChildren" | |
363 | prototype: "QtCommercialChart::QCategoryAxis" |
|
399 | prototype: "QtCommercialChart::QCategoryAxis" | |
364 | exports: ["QtCommercial.Chart/CategoryAxis 1.1"] |
|
400 | exports: ["QtCommercial.Chart/CategoryAxis 1.1"] | |
365 | exportMetaObjectRevisions: [0] |
|
401 | exportMetaObjectRevisions: [0] | |
366 | Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
402 | Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true } | |
367 | Method { |
|
403 | Method { | |
368 | name: "append" |
|
404 | name: "append" | |
369 | Parameter { name: "label"; type: "string" } |
|
405 | Parameter { name: "label"; type: "string" } | |
370 | Parameter { name: "categoryEndValue"; type: "double" } |
|
406 | Parameter { name: "categoryEndValue"; type: "double" } | |
371 | } |
|
407 | } | |
372 | Method { |
|
408 | Method { | |
373 | name: "remove" |
|
409 | name: "remove" | |
374 | Parameter { name: "label"; type: "string" } |
|
410 | Parameter { name: "label"; type: "string" } | |
375 | } |
|
411 | } | |
376 | Method { |
|
412 | Method { | |
377 | name: "replace" |
|
413 | name: "replace" | |
378 | Parameter { name: "oldLabel"; type: "string" } |
|
414 | Parameter { name: "oldLabel"; type: "string" } | |
379 | Parameter { name: "newLabel"; type: "string" } |
|
415 | Parameter { name: "newLabel"; type: "string" } | |
380 | } |
|
416 | } | |
381 | Method { |
|
417 | Method { | |
382 | name: "appendAxisChildren" |
|
418 | name: "appendAxisChildren" | |
383 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
419 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
384 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
420 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
385 | } |
|
421 | } | |
386 | } |
|
422 | } | |
387 | Component { |
|
423 | Component { | |
388 | name: "QtCommercialChart::DeclarativeCategoryRange" |
|
424 | name: "QtCommercialChart::DeclarativeCategoryRange" | |
389 | prototype: "QObject" |
|
425 | prototype: "QObject" | |
390 | exports: ["QtCommercial.Chart/CategoryRange 1.1"] |
|
426 | exports: ["QtCommercial.Chart/CategoryRange 1.1"] | |
391 | exportMetaObjectRevisions: [0] |
|
427 | exportMetaObjectRevisions: [0] | |
392 | Property { name: "endValue"; type: "double" } |
|
428 | Property { name: "endValue"; type: "double" } | |
393 | Property { name: "label"; type: "string" } |
|
429 | Property { name: "label"; type: "string" } | |
394 | } |
|
430 | } | |
395 | Component { |
|
431 | Component { | |
396 | name: "QtCommercialChart::DeclarativeChart" |
|
432 | name: "QtCommercialChart::DeclarativeChart" | |
397 | defaultProperty: "data" |
|
433 | defaultProperty: "data" | |
398 | prototype: "QQuickPaintedItem" |
|
434 | prototype: "QQuickPaintedItem" | |
399 | exports: [ |
|
435 | exports: [ | |
400 | "QtCommercial.Chart/ChartView 1.0", |
|
436 | "QtCommercial.Chart/ChartView 1.0", | |
401 | "QtCommercial.Chart/ChartView 1.1", |
|
437 | "QtCommercial.Chart/ChartView 1.1", | |
402 | "QtCommercial.Chart/ChartView 1.2", |
|
438 | "QtCommercial.Chart/ChartView 1.2", | |
403 | "QtCommercial.Chart/ChartView 1.3" |
|
439 | "QtCommercial.Chart/ChartView 1.3" | |
404 | ] |
|
440 | ] | |
405 | exportMetaObjectRevisions: [0, 1, 2, 3] |
|
441 | exportMetaObjectRevisions: [0, 1, 2, 3] | |
406 | Enum { |
|
442 | Enum { | |
407 | name: "Theme" |
|
443 | name: "Theme" | |
408 | values: { |
|
444 | values: { | |
409 | "ChartThemeLight": 0, |
|
445 | "ChartThemeLight": 0, | |
410 | "ChartThemeBlueCerulean": 1, |
|
446 | "ChartThemeBlueCerulean": 1, | |
411 | "ChartThemeDark": 2, |
|
447 | "ChartThemeDark": 2, | |
412 | "ChartThemeBrownSand": 3, |
|
448 | "ChartThemeBrownSand": 3, | |
413 | "ChartThemeBlueNcs": 4, |
|
449 | "ChartThemeBlueNcs": 4, | |
414 | "ChartThemeHighContrast": 5, |
|
450 | "ChartThemeHighContrast": 5, | |
415 | "ChartThemeBlueIcy": 6, |
|
451 | "ChartThemeBlueIcy": 6, | |
416 | "ChartThemeQt": 7 |
|
452 | "ChartThemeQt": 7 | |
417 | } |
|
453 | } | |
418 | } |
|
454 | } | |
419 | Enum { |
|
455 | Enum { | |
420 | name: "Animation" |
|
456 | name: "Animation" | |
421 | values: { |
|
457 | values: { | |
422 | "NoAnimation": 0, |
|
458 | "NoAnimation": 0, | |
423 | "GridAxisAnimations": 1, |
|
459 | "GridAxisAnimations": 1, | |
424 | "SeriesAnimations": 2, |
|
460 | "SeriesAnimations": 2, | |
425 | "AllAnimations": 3 |
|
461 | "AllAnimations": 3 | |
426 | } |
|
462 | } | |
427 | } |
|
463 | } | |
428 | Enum { |
|
464 | Enum { | |
429 | name: "SeriesType" |
|
465 | name: "SeriesType" | |
430 | values: { |
|
466 | values: { | |
431 | "SeriesTypeLine": 0, |
|
467 | "SeriesTypeLine": 0, | |
432 | "SeriesTypeArea": 1, |
|
468 | "SeriesTypeArea": 1, | |
433 | "SeriesTypeBar": 2, |
|
469 | "SeriesTypeBar": 2, | |
434 | "SeriesTypeStackedBar": 3, |
|
470 | "SeriesTypeStackedBar": 3, | |
435 | "SeriesTypePercentBar": 4, |
|
471 | "SeriesTypePercentBar": 4, | |
436 | "SeriesTypeBoxPlot": 5, |
|
472 | "SeriesTypeBoxPlot": 5, | |
437 | "SeriesTypePie": 6, |
|
473 | "SeriesTypePie": 6, | |
438 | "SeriesTypeScatter": 7, |
|
474 | "SeriesTypeScatter": 7, | |
439 | "SeriesTypeSpline": 8, |
|
475 | "SeriesTypeSpline": 8, | |
440 | "SeriesTypeHorizontalBar": 9, |
|
476 | "SeriesTypeHorizontalBar": 9, | |
441 | "SeriesTypeHorizontalStackedBar": 10, |
|
477 | "SeriesTypeHorizontalStackedBar": 10, | |
442 | "SeriesTypeHorizontalPercentBar": 11 |
|
478 | "SeriesTypeHorizontalPercentBar": 11 | |
443 | } |
|
479 | } | |
444 | } |
|
480 | } | |
445 | Property { name: "theme"; type: "Theme" } |
|
481 | Property { name: "theme"; type: "Theme" } | |
446 | Property { name: "animationOptions"; type: "Animation" } |
|
482 | Property { name: "animationOptions"; type: "Animation" } | |
447 | Property { name: "title"; type: "string" } |
|
483 | Property { name: "title"; type: "string" } | |
448 | Property { name: "titleFont"; type: "QFont" } |
|
484 | Property { name: "titleFont"; type: "QFont" } | |
449 | Property { name: "titleColor"; type: "QColor" } |
|
485 | Property { name: "titleColor"; type: "QColor" } | |
450 | Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true } |
|
486 | Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true } | |
451 | Property { name: "count"; type: "int"; isReadonly: true } |
|
487 | Property { name: "count"; type: "int"; isReadonly: true } | |
452 | Property { name: "backgroundColor"; type: "QColor" } |
|
488 | Property { name: "backgroundColor"; type: "QColor" } | |
453 | Property { name: "dropShadowEnabled"; type: "bool" } |
|
489 | Property { name: "dropShadowEnabled"; type: "bool" } | |
454 | Property { name: "backgroundRoundness"; revision: 3; type: "double" } |
|
490 | Property { name: "backgroundRoundness"; revision: 3; type: "double" } | |
455 | Property { name: "topMargin"; type: "double"; isReadonly: true } |
|
491 | Property { name: "topMargin"; type: "double"; isReadonly: true } | |
456 | Property { name: "bottomMargin"; type: "double"; isReadonly: true } |
|
492 | Property { name: "bottomMargin"; type: "double"; isReadonly: true } | |
457 | Property { name: "leftMargin"; type: "double"; isReadonly: true } |
|
493 | Property { name: "leftMargin"; type: "double"; isReadonly: true } | |
458 | Property { name: "rightMargin"; type: "double"; isReadonly: true } |
|
494 | Property { name: "rightMargin"; type: "double"; isReadonly: true } | |
459 | Property { |
|
495 | Property { | |
460 | name: "minimumMargins" |
|
496 | name: "minimumMargins" | |
461 | revision: 1 |
|
497 | revision: 1 | |
462 | type: "DeclarativeMargins" |
|
498 | type: "DeclarativeMargins" | |
463 | isReadonly: true |
|
499 | isReadonly: true | |
464 | isPointer: true |
|
500 | isPointer: true | |
465 | } |
|
501 | } | |
466 | Property { |
|
502 | Property { | |
467 | name: "margins" |
|
503 | name: "margins" | |
468 | revision: 2 |
|
504 | revision: 2 | |
469 | type: "DeclarativeMargins" |
|
505 | type: "DeclarativeMargins" | |
470 | isReadonly: true |
|
506 | isReadonly: true | |
471 | isPointer: true |
|
507 | isPointer: true | |
472 | } |
|
508 | } | |
473 | Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true } |
|
509 | Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true } | |
474 | Property { name: "plotAreaColor"; revision: 3; type: "QColor" } |
|
510 | Property { name: "plotAreaColor"; revision: 3; type: "QColor" } | |
475 | Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true } |
|
511 | Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true } | |
476 | Signal { name: "axisLabelsChanged" } |
|
512 | Signal { name: "axisLabelsChanged" } | |
477 | Signal { |
|
513 | Signal { | |
478 | name: "titleColorChanged" |
|
514 | name: "titleColorChanged" | |
479 | Parameter { name: "color"; type: "QColor" } |
|
515 | Parameter { name: "color"; type: "QColor" } | |
480 | } |
|
516 | } | |
481 | Signal { |
|
517 | Signal { | |
482 | name: "dropShadowEnabledChanged" |
|
518 | name: "dropShadowEnabledChanged" | |
483 | Parameter { name: "enabled"; type: "bool" } |
|
519 | Parameter { name: "enabled"; type: "bool" } | |
484 | } |
|
520 | } | |
485 | Signal { name: "marginsChanged"; revision: 2 } |
|
521 | Signal { name: "marginsChanged"; revision: 2 } | |
486 | Signal { |
|
522 | Signal { | |
487 | name: "plotAreaChanged" |
|
523 | name: "plotAreaChanged" | |
488 | Parameter { name: "plotArea"; type: "QRectF" } |
|
524 | Parameter { name: "plotArea"; type: "QRectF" } | |
489 | } |
|
525 | } | |
490 | Signal { |
|
526 | Signal { | |
491 | name: "seriesAdded" |
|
527 | name: "seriesAdded" | |
492 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
528 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
493 | } |
|
529 | } | |
494 | Signal { |
|
530 | Signal { | |
495 | name: "seriesRemoved" |
|
531 | name: "seriesRemoved" | |
496 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
532 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
497 | } |
|
533 | } | |
498 | Signal { name: "plotAreaColorChanged"; revision: 3 } |
|
534 | Signal { name: "plotAreaColorChanged"; revision: 3 } | |
499 | Signal { |
|
535 | Signal { | |
500 | name: "backgroundRoundnessChanged" |
|
536 | name: "backgroundRoundnessChanged" | |
501 | revision: 3 |
|
537 | revision: 3 | |
502 | Parameter { name: "diameter"; type: "double" } |
|
538 | Parameter { name: "diameter"; type: "double" } | |
503 | } |
|
539 | } | |
504 | Method { |
|
540 | Method { | |
505 | name: "series" |
|
541 | name: "series" | |
506 | type: "QAbstractSeries*" |
|
542 | type: "QAbstractSeries*" | |
507 | Parameter { name: "index"; type: "int" } |
|
543 | Parameter { name: "index"; type: "int" } | |
508 | } |
|
544 | } | |
509 | Method { |
|
545 | Method { | |
510 | name: "series" |
|
546 | name: "series" | |
511 | type: "QAbstractSeries*" |
|
547 | type: "QAbstractSeries*" | |
512 | Parameter { name: "seriesName"; type: "string" } |
|
548 | Parameter { name: "seriesName"; type: "string" } | |
513 | } |
|
549 | } | |
514 | Method { |
|
550 | Method { | |
515 | name: "createSeries" |
|
551 | name: "createSeries" | |
516 | type: "QAbstractSeries*" |
|
552 | type: "QAbstractSeries*" | |
517 | Parameter { name: "type"; type: "int" } |
|
553 | Parameter { name: "type"; type: "int" } | |
518 | Parameter { name: "name"; type: "string" } |
|
554 | Parameter { name: "name"; type: "string" } | |
519 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
555 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
520 | Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true } |
|
556 | Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true } | |
521 | } |
|
557 | } | |
522 | Method { |
|
558 | Method { | |
523 | name: "createSeries" |
|
559 | name: "createSeries" | |
524 | type: "QAbstractSeries*" |
|
560 | type: "QAbstractSeries*" | |
525 | Parameter { name: "type"; type: "int" } |
|
561 | Parameter { name: "type"; type: "int" } | |
526 | Parameter { name: "name"; type: "string" } |
|
562 | Parameter { name: "name"; type: "string" } | |
527 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
563 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
528 | } |
|
564 | } | |
529 | Method { |
|
565 | Method { | |
530 | name: "createSeries" |
|
566 | name: "createSeries" | |
531 | type: "QAbstractSeries*" |
|
567 | type: "QAbstractSeries*" | |
532 | Parameter { name: "type"; type: "int" } |
|
568 | Parameter { name: "type"; type: "int" } | |
533 | Parameter { name: "name"; type: "string" } |
|
569 | Parameter { name: "name"; type: "string" } | |
534 | } |
|
570 | } | |
535 | Method { |
|
571 | Method { | |
536 | name: "createSeries" |
|
572 | name: "createSeries" | |
537 | type: "QAbstractSeries*" |
|
573 | type: "QAbstractSeries*" | |
538 | Parameter { name: "type"; type: "int" } |
|
574 | Parameter { name: "type"; type: "int" } | |
539 | } |
|
575 | } | |
540 | Method { |
|
576 | Method { | |
541 | name: "removeSeries" |
|
577 | name: "removeSeries" | |
542 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
578 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
543 | } |
|
579 | } | |
544 | Method { name: "removeAllSeries" } |
|
580 | Method { name: "removeAllSeries" } | |
545 | Method { |
|
581 | Method { | |
546 | name: "setAxisX" |
|
582 | name: "setAxisX" | |
547 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
583 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
548 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
584 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
549 | } |
|
585 | } | |
550 | Method { |
|
586 | Method { | |
551 | name: "setAxisX" |
|
587 | name: "setAxisX" | |
552 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
588 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
553 | } |
|
589 | } | |
554 | Method { |
|
590 | Method { | |
555 | name: "setAxisY" |
|
591 | name: "setAxisY" | |
556 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
592 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
557 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
593 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
558 | } |
|
594 | } | |
559 | Method { |
|
595 | Method { | |
560 | name: "setAxisY" |
|
596 | name: "setAxisY" | |
561 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
597 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
562 | } |
|
598 | } | |
563 | Method { name: "createDefaultAxes" } |
|
599 | Method { name: "createDefaultAxes" } | |
564 | Method { |
|
600 | Method { | |
565 | name: "axisX" |
|
601 | name: "axisX" | |
566 | type: "QAbstractAxis*" |
|
602 | type: "QAbstractAxis*" | |
567 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
603 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
568 | } |
|
604 | } | |
569 | Method { name: "axisX"; type: "QAbstractAxis*" } |
|
605 | Method { name: "axisX"; type: "QAbstractAxis*" } | |
570 | Method { |
|
606 | Method { | |
571 | name: "axisY" |
|
607 | name: "axisY" | |
572 | type: "QAbstractAxis*" |
|
608 | type: "QAbstractAxis*" | |
573 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
609 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
574 | } |
|
610 | } | |
575 | Method { name: "axisY"; type: "QAbstractAxis*" } |
|
611 | Method { name: "axisY"; type: "QAbstractAxis*" } | |
576 | Method { |
|
612 | Method { | |
577 | name: "zoom" |
|
613 | name: "zoom" | |
578 | Parameter { name: "factor"; type: "double" } |
|
614 | Parameter { name: "factor"; type: "double" } | |
579 | } |
|
615 | } | |
580 | Method { |
|
616 | Method { | |
581 | name: "scrollLeft" |
|
617 | name: "scrollLeft" | |
582 | Parameter { name: "pixels"; type: "double" } |
|
618 | Parameter { name: "pixels"; type: "double" } | |
583 | } |
|
619 | } | |
584 | Method { |
|
620 | Method { | |
585 | name: "scrollRight" |
|
621 | name: "scrollRight" | |
586 | Parameter { name: "pixels"; type: "double" } |
|
622 | Parameter { name: "pixels"; type: "double" } | |
587 | } |
|
623 | } | |
588 | Method { |
|
624 | Method { | |
589 | name: "scrollUp" |
|
625 | name: "scrollUp" | |
590 | Parameter { name: "pixels"; type: "double" } |
|
626 | Parameter { name: "pixels"; type: "double" } | |
591 | } |
|
627 | } | |
592 | Method { |
|
628 | Method { | |
593 | name: "scrollDown" |
|
629 | name: "scrollDown" | |
594 | Parameter { name: "pixels"; type: "double" } |
|
630 | Parameter { name: "pixels"; type: "double" } | |
595 | } |
|
631 | } | |
596 | } |
|
632 | } | |
597 | Component { |
|
633 | Component { | |
598 | name: "QtCommercialChart::DeclarativeHorizontalBarSeries" |
|
634 | name: "QtCommercialChart::DeclarativeHorizontalBarSeries" | |
599 | defaultProperty: "seriesChildren" |
|
635 | defaultProperty: "seriesChildren" | |
600 | prototype: "QtCommercialChart::QHorizontalBarSeries" |
|
636 | prototype: "QtCommercialChart::QHorizontalBarSeries" | |
601 | exports: [ |
|
637 | exports: [ | |
602 | "QtCommercial.Chart/HorizontalBarSeries 1.1", |
|
638 | "QtCommercial.Chart/HorizontalBarSeries 1.1", | |
603 | "QtCommercial.Chart/HorizontalBarSeries 1.2" |
|
639 | "QtCommercial.Chart/HorizontalBarSeries 1.2" | |
604 | ] |
|
640 | ] | |
605 | exportMetaObjectRevisions: [1, 2] |
|
641 | exportMetaObjectRevisions: [1, 2] | |
606 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
642 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
607 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
643 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
608 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
644 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
609 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
645 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
610 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
646 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
611 | Signal { |
|
647 | Signal { | |
612 | name: "axisXChanged" |
|
648 | name: "axisXChanged" | |
613 | revision: 1 |
|
649 | revision: 1 | |
614 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
650 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
615 | } |
|
651 | } | |
616 | Signal { |
|
652 | Signal { | |
617 | name: "axisYChanged" |
|
653 | name: "axisYChanged" | |
618 | revision: 1 |
|
654 | revision: 1 | |
619 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
655 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
620 | } |
|
656 | } | |
621 | Signal { |
|
657 | Signal { | |
622 | name: "axisXTopChanged" |
|
658 | name: "axisXTopChanged" | |
623 | revision: 2 |
|
659 | revision: 2 | |
624 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
660 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
625 | } |
|
661 | } | |
626 | Signal { |
|
662 | Signal { | |
627 | name: "axisYRightChanged" |
|
663 | name: "axisYRightChanged" | |
628 | revision: 2 |
|
664 | revision: 2 | |
629 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
665 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
630 | } |
|
666 | } | |
631 | Method { |
|
667 | Method { | |
632 | name: "appendSeriesChildren" |
|
668 | name: "appendSeriesChildren" | |
633 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
669 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
634 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
670 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
635 | } |
|
671 | } | |
636 | Method { |
|
672 | Method { | |
637 | name: "at" |
|
673 | name: "at" | |
638 | type: "DeclarativeBarSet*" |
|
674 | type: "DeclarativeBarSet*" | |
639 | Parameter { name: "index"; type: "int" } |
|
675 | Parameter { name: "index"; type: "int" } | |
640 | } |
|
676 | } | |
641 | Method { |
|
677 | Method { | |
642 | name: "append" |
|
678 | name: "append" | |
643 | type: "DeclarativeBarSet*" |
|
679 | type: "DeclarativeBarSet*" | |
644 | Parameter { name: "label"; type: "string" } |
|
680 | Parameter { name: "label"; type: "string" } | |
645 | Parameter { name: "values"; type: "QVariantList" } |
|
681 | Parameter { name: "values"; type: "QVariantList" } | |
646 | } |
|
682 | } | |
647 | Method { |
|
683 | Method { | |
648 | name: "insert" |
|
684 | name: "insert" | |
649 | type: "DeclarativeBarSet*" |
|
685 | type: "DeclarativeBarSet*" | |
650 | Parameter { name: "index"; type: "int" } |
|
686 | Parameter { name: "index"; type: "int" } | |
651 | Parameter { name: "label"; type: "string" } |
|
687 | Parameter { name: "label"; type: "string" } | |
652 | Parameter { name: "values"; type: "QVariantList" } |
|
688 | Parameter { name: "values"; type: "QVariantList" } | |
653 | } |
|
689 | } | |
654 | Method { |
|
690 | Method { | |
655 | name: "remove" |
|
691 | name: "remove" | |
656 | type: "bool" |
|
692 | type: "bool" | |
657 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
693 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
658 | } |
|
694 | } | |
659 | Method { name: "clear" } |
|
695 | Method { name: "clear" } | |
660 | } |
|
696 | } | |
661 | Component { |
|
697 | Component { | |
662 | name: "QtCommercialChart::DeclarativeHorizontalPercentBarSeries" |
|
698 | name: "QtCommercialChart::DeclarativeHorizontalPercentBarSeries" | |
663 | defaultProperty: "seriesChildren" |
|
699 | defaultProperty: "seriesChildren" | |
664 | prototype: "QtCommercialChart::QHorizontalPercentBarSeries" |
|
700 | prototype: "QtCommercialChart::QHorizontalPercentBarSeries" | |
665 | exports: [ |
|
701 | exports: [ | |
666 | "QtCommercial.Chart/HorizontalPercentBarSeries 1.1", |
|
702 | "QtCommercial.Chart/HorizontalPercentBarSeries 1.1", | |
667 | "QtCommercial.Chart/HorizontalPercentBarSeries 1.2" |
|
703 | "QtCommercial.Chart/HorizontalPercentBarSeries 1.2" | |
668 | ] |
|
704 | ] | |
669 | exportMetaObjectRevisions: [1, 2] |
|
705 | exportMetaObjectRevisions: [1, 2] | |
670 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
706 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
671 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
707 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
672 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
708 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
673 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
709 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
674 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
710 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
675 | Signal { |
|
711 | Signal { | |
676 | name: "axisXChanged" |
|
712 | name: "axisXChanged" | |
677 | revision: 1 |
|
713 | revision: 1 | |
678 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
714 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
679 | } |
|
715 | } | |
680 | Signal { |
|
716 | Signal { | |
681 | name: "axisYChanged" |
|
717 | name: "axisYChanged" | |
682 | revision: 1 |
|
718 | revision: 1 | |
683 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
719 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
684 | } |
|
720 | } | |
685 | Signal { |
|
721 | Signal { | |
686 | name: "axisXTopChanged" |
|
722 | name: "axisXTopChanged" | |
687 | revision: 2 |
|
723 | revision: 2 | |
688 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
724 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
689 | } |
|
725 | } | |
690 | Signal { |
|
726 | Signal { | |
691 | name: "axisYRightChanged" |
|
727 | name: "axisYRightChanged" | |
692 | revision: 2 |
|
728 | revision: 2 | |
693 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
729 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
694 | } |
|
730 | } | |
695 | Method { |
|
731 | Method { | |
696 | name: "appendSeriesChildren" |
|
732 | name: "appendSeriesChildren" | |
697 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
733 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
698 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
734 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
699 | } |
|
735 | } | |
700 | Method { |
|
736 | Method { | |
701 | name: "at" |
|
737 | name: "at" | |
702 | type: "DeclarativeBarSet*" |
|
738 | type: "DeclarativeBarSet*" | |
703 | Parameter { name: "index"; type: "int" } |
|
739 | Parameter { name: "index"; type: "int" } | |
704 | } |
|
740 | } | |
705 | Method { |
|
741 | Method { | |
706 | name: "append" |
|
742 | name: "append" | |
707 | type: "DeclarativeBarSet*" |
|
743 | type: "DeclarativeBarSet*" | |
708 | Parameter { name: "label"; type: "string" } |
|
744 | Parameter { name: "label"; type: "string" } | |
709 | Parameter { name: "values"; type: "QVariantList" } |
|
745 | Parameter { name: "values"; type: "QVariantList" } | |
710 | } |
|
746 | } | |
711 | Method { |
|
747 | Method { | |
712 | name: "insert" |
|
748 | name: "insert" | |
713 | type: "DeclarativeBarSet*" |
|
749 | type: "DeclarativeBarSet*" | |
714 | Parameter { name: "index"; type: "int" } |
|
750 | Parameter { name: "index"; type: "int" } | |
715 | Parameter { name: "label"; type: "string" } |
|
751 | Parameter { name: "label"; type: "string" } | |
716 | Parameter { name: "values"; type: "QVariantList" } |
|
752 | Parameter { name: "values"; type: "QVariantList" } | |
717 | } |
|
753 | } | |
718 | Method { |
|
754 | Method { | |
719 | name: "remove" |
|
755 | name: "remove" | |
720 | type: "bool" |
|
756 | type: "bool" | |
721 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
757 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
722 | } |
|
758 | } | |
723 | Method { name: "clear" } |
|
759 | Method { name: "clear" } | |
724 | } |
|
760 | } | |
725 | Component { |
|
761 | Component { | |
726 | name: "QtCommercialChart::DeclarativeHorizontalStackedBarSeries" |
|
762 | name: "QtCommercialChart::DeclarativeHorizontalStackedBarSeries" | |
727 | defaultProperty: "seriesChildren" |
|
763 | defaultProperty: "seriesChildren" | |
728 | prototype: "QtCommercialChart::QHorizontalStackedBarSeries" |
|
764 | prototype: "QtCommercialChart::QHorizontalStackedBarSeries" | |
729 | exports: [ |
|
765 | exports: [ | |
730 | "QtCommercial.Chart/HorizontalStackedBarSeries 1.1", |
|
766 | "QtCommercial.Chart/HorizontalStackedBarSeries 1.1", | |
731 | "QtCommercial.Chart/HorizontalStackedBarSeries 1.2" |
|
767 | "QtCommercial.Chart/HorizontalStackedBarSeries 1.2" | |
732 | ] |
|
768 | ] | |
733 | exportMetaObjectRevisions: [1, 2] |
|
769 | exportMetaObjectRevisions: [1, 2] | |
734 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
770 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
735 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
771 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
736 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
772 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
737 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
773 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
738 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
774 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
739 | Signal { |
|
775 | Signal { | |
740 | name: "axisXChanged" |
|
776 | name: "axisXChanged" | |
741 | revision: 1 |
|
777 | revision: 1 | |
742 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
778 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
743 | } |
|
779 | } | |
744 | Signal { |
|
780 | Signal { | |
745 | name: "axisYChanged" |
|
781 | name: "axisYChanged" | |
746 | revision: 1 |
|
782 | revision: 1 | |
747 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
783 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
748 | } |
|
784 | } | |
749 | Signal { |
|
785 | Signal { | |
750 | name: "axisXTopChanged" |
|
786 | name: "axisXTopChanged" | |
751 | revision: 2 |
|
787 | revision: 2 | |
752 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
788 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
753 | } |
|
789 | } | |
754 | Signal { |
|
790 | Signal { | |
755 | name: "axisYRightChanged" |
|
791 | name: "axisYRightChanged" | |
756 | revision: 2 |
|
792 | revision: 2 | |
757 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
793 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
758 | } |
|
794 | } | |
759 | Method { |
|
795 | Method { | |
760 | name: "appendSeriesChildren" |
|
796 | name: "appendSeriesChildren" | |
761 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
797 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
762 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
798 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
763 | } |
|
799 | } | |
764 | Method { |
|
800 | Method { | |
765 | name: "at" |
|
801 | name: "at" | |
766 | type: "DeclarativeBarSet*" |
|
802 | type: "DeclarativeBarSet*" | |
767 | Parameter { name: "index"; type: "int" } |
|
803 | Parameter { name: "index"; type: "int" } | |
768 | } |
|
804 | } | |
769 | Method { |
|
805 | Method { | |
770 | name: "append" |
|
806 | name: "append" | |
771 | type: "DeclarativeBarSet*" |
|
807 | type: "DeclarativeBarSet*" | |
772 | Parameter { name: "label"; type: "string" } |
|
808 | Parameter { name: "label"; type: "string" } | |
773 | Parameter { name: "values"; type: "QVariantList" } |
|
809 | Parameter { name: "values"; type: "QVariantList" } | |
774 | } |
|
810 | } | |
775 | Method { |
|
811 | Method { | |
776 | name: "insert" |
|
812 | name: "insert" | |
777 | type: "DeclarativeBarSet*" |
|
813 | type: "DeclarativeBarSet*" | |
778 | Parameter { name: "index"; type: "int" } |
|
814 | Parameter { name: "index"; type: "int" } | |
779 | Parameter { name: "label"; type: "string" } |
|
815 | Parameter { name: "label"; type: "string" } | |
780 | Parameter { name: "values"; type: "QVariantList" } |
|
816 | Parameter { name: "values"; type: "QVariantList" } | |
781 | } |
|
817 | } | |
782 | Method { |
|
818 | Method { | |
783 | name: "remove" |
|
819 | name: "remove" | |
784 | type: "bool" |
|
820 | type: "bool" | |
785 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
821 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
786 | } |
|
822 | } | |
787 | Method { name: "clear" } |
|
823 | Method { name: "clear" } | |
788 | } |
|
824 | } | |
789 | Component { |
|
825 | Component { | |
790 | name: "QtCommercialChart::DeclarativeLineSeries" |
|
826 | name: "QtCommercialChart::DeclarativeLineSeries" | |
791 | defaultProperty: "declarativeChildren" |
|
827 | defaultProperty: "declarativeChildren" | |
792 | prototype: "QtCommercialChart::QLineSeries" |
|
828 | prototype: "QtCommercialChart::QLineSeries" | |
793 | exports: [ |
|
829 | exports: [ | |
794 | "QtCommercial.Chart/LineSeries 1.0", |
|
830 | "QtCommercial.Chart/LineSeries 1.0", | |
795 | "QtCommercial.Chart/LineSeries 1.1", |
|
831 | "QtCommercial.Chart/LineSeries 1.1", | |
796 | "QtCommercial.Chart/LineSeries 1.2", |
|
832 | "QtCommercial.Chart/LineSeries 1.2", | |
797 | "QtCommercial.Chart/LineSeries 1.3" |
|
833 | "QtCommercial.Chart/LineSeries 1.3" | |
798 | ] |
|
834 | ] | |
799 | exportMetaObjectRevisions: [0, 1, 2, 3] |
|
835 | exportMetaObjectRevisions: [0, 1, 2, 3] | |
800 | Property { name: "count"; type: "int"; isReadonly: true } |
|
836 | Property { name: "count"; type: "int"; isReadonly: true } | |
801 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
837 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
802 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
838 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
803 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
839 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
804 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
840 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
805 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
841 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
806 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
842 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
807 | Property { name: "width"; revision: 1; type: "double" } |
|
843 | Property { name: "width"; revision: 1; type: "double" } | |
808 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } |
|
844 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } | |
809 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } |
|
845 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } | |
810 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
846 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } | |
811 | Signal { |
|
847 | Signal { | |
812 | name: "countChanged" |
|
848 | name: "countChanged" | |
813 | Parameter { name: "count"; type: "int" } |
|
849 | Parameter { name: "count"; type: "int" } | |
814 | } |
|
850 | } | |
815 | Signal { |
|
851 | Signal { | |
816 | name: "axisXChanged" |
|
852 | name: "axisXChanged" | |
817 | revision: 1 |
|
853 | revision: 1 | |
818 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
854 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
819 | } |
|
855 | } | |
820 | Signal { |
|
856 | Signal { | |
821 | name: "axisYChanged" |
|
857 | name: "axisYChanged" | |
822 | revision: 1 |
|
858 | revision: 1 | |
823 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
859 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
824 | } |
|
860 | } | |
825 | Signal { |
|
861 | Signal { | |
826 | name: "axisXTopChanged" |
|
862 | name: "axisXTopChanged" | |
827 | revision: 2 |
|
863 | revision: 2 | |
828 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
864 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
829 | } |
|
865 | } | |
830 | Signal { |
|
866 | Signal { | |
831 | name: "axisYRightChanged" |
|
867 | name: "axisYRightChanged" | |
832 | revision: 2 |
|
868 | revision: 2 | |
833 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
869 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
834 | } |
|
870 | } | |
835 | Signal { |
|
871 | Signal { | |
836 | name: "axisAngularChanged" |
|
872 | name: "axisAngularChanged" | |
837 | revision: 3 |
|
873 | revision: 3 | |
838 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
874 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
839 | } |
|
875 | } | |
840 | Signal { |
|
876 | Signal { | |
841 | name: "axisRadialChanged" |
|
877 | name: "axisRadialChanged" | |
842 | revision: 3 |
|
878 | revision: 3 | |
843 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
879 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
844 | } |
|
880 | } | |
845 | Signal { |
|
881 | Signal { | |
846 | name: "widthChanged" |
|
882 | name: "widthChanged" | |
847 | revision: 1 |
|
883 | revision: 1 | |
848 | Parameter { name: "width"; type: "double" } |
|
884 | Parameter { name: "width"; type: "double" } | |
849 | } |
|
885 | } | |
850 | Signal { |
|
886 | Signal { | |
851 | name: "styleChanged" |
|
887 | name: "styleChanged" | |
852 | revision: 1 |
|
888 | revision: 1 | |
853 | Parameter { name: "style"; type: "Qt::PenStyle" } |
|
889 | Parameter { name: "style"; type: "Qt::PenStyle" } | |
854 | } |
|
890 | } | |
855 | Signal { |
|
891 | Signal { | |
856 | name: "capStyleChanged" |
|
892 | name: "capStyleChanged" | |
857 | revision: 1 |
|
893 | revision: 1 | |
858 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } |
|
894 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } | |
859 | } |
|
895 | } | |
860 | Method { |
|
896 | Method { | |
861 | name: "appendDeclarativeChildren" |
|
897 | name: "appendDeclarativeChildren" | |
862 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
898 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
863 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
899 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
864 | } |
|
900 | } | |
865 | Method { |
|
901 | Method { | |
866 | name: "handleCountChanged" |
|
902 | name: "handleCountChanged" | |
867 | Parameter { name: "index"; type: "int" } |
|
903 | Parameter { name: "index"; type: "int" } | |
868 | } |
|
904 | } | |
869 | Method { |
|
905 | Method { | |
870 | name: "append" |
|
906 | name: "append" | |
871 | Parameter { name: "x"; type: "double" } |
|
907 | Parameter { name: "x"; type: "double" } | |
872 | Parameter { name: "y"; type: "double" } |
|
908 | Parameter { name: "y"; type: "double" } | |
873 | } |
|
909 | } | |
874 | Method { |
|
910 | Method { | |
875 | name: "replace" |
|
911 | name: "replace" | |
876 | Parameter { name: "oldX"; type: "double" } |
|
912 | Parameter { name: "oldX"; type: "double" } | |
877 | Parameter { name: "oldY"; type: "double" } |
|
913 | Parameter { name: "oldY"; type: "double" } | |
878 | Parameter { name: "newX"; type: "double" } |
|
914 | Parameter { name: "newX"; type: "double" } | |
879 | Parameter { name: "newY"; type: "double" } |
|
915 | Parameter { name: "newY"; type: "double" } | |
880 | } |
|
916 | } | |
881 | Method { |
|
917 | Method { | |
882 | name: "replace" |
|
918 | name: "replace" | |
883 | revision: 3 |
|
919 | revision: 3 | |
884 | Parameter { name: "index"; type: "int" } |
|
920 | Parameter { name: "index"; type: "int" } | |
885 | Parameter { name: "newX"; type: "double" } |
|
921 | Parameter { name: "newX"; type: "double" } | |
886 | Parameter { name: "newY"; type: "double" } |
|
922 | Parameter { name: "newY"; type: "double" } | |
887 | } |
|
923 | } | |
888 | Method { |
|
924 | Method { | |
889 | name: "remove" |
|
925 | name: "remove" | |
890 | Parameter { name: "x"; type: "double" } |
|
926 | Parameter { name: "x"; type: "double" } | |
891 | Parameter { name: "y"; type: "double" } |
|
927 | Parameter { name: "y"; type: "double" } | |
892 | } |
|
928 | } | |
893 | Method { |
|
929 | Method { | |
894 | name: "remove" |
|
930 | name: "remove" | |
895 | revision: 3 |
|
931 | revision: 3 | |
896 | Parameter { name: "index"; type: "int" } |
|
932 | Parameter { name: "index"; type: "int" } | |
897 | } |
|
933 | } | |
898 | Method { |
|
934 | Method { | |
899 | name: "insert" |
|
935 | name: "insert" | |
900 | Parameter { name: "index"; type: "int" } |
|
936 | Parameter { name: "index"; type: "int" } | |
901 | Parameter { name: "x"; type: "double" } |
|
937 | Parameter { name: "x"; type: "double" } | |
902 | Parameter { name: "y"; type: "double" } |
|
938 | Parameter { name: "y"; type: "double" } | |
903 | } |
|
939 | } | |
904 | Method { name: "clear" } |
|
940 | Method { name: "clear" } | |
905 | Method { |
|
941 | Method { | |
906 | name: "at" |
|
942 | name: "at" | |
907 | type: "QPointF" |
|
943 | type: "QPointF" | |
908 | Parameter { name: "index"; type: "int" } |
|
944 | Parameter { name: "index"; type: "int" } | |
909 | } |
|
945 | } | |
910 | } |
|
946 | } | |
911 | Component { |
|
947 | Component { | |
912 | name: "QtCommercialChart::DeclarativeMargins" |
|
948 | name: "QtCommercialChart::DeclarativeMargins" | |
913 | prototype: "QObject" |
|
949 | prototype: "QObject" | |
914 | exports: ["QtCommercial.Chart/Margins 1.1"] |
|
950 | exports: ["QtCommercial.Chart/Margins 1.1"] | |
915 | isCreatable: false |
|
|||
916 | exportMetaObjectRevisions: [0] |
|
951 | exportMetaObjectRevisions: [0] | |
917 | Property { name: "top"; type: "int" } |
|
952 | Property { name: "top"; type: "int" } | |
918 | Property { name: "bottom"; type: "int" } |
|
953 | Property { name: "bottom"; type: "int" } | |
919 | Property { name: "left"; type: "int" } |
|
954 | Property { name: "left"; type: "int" } | |
920 | Property { name: "right"; type: "int" } |
|
955 | Property { name: "right"; type: "int" } | |
921 | Signal { |
|
956 | Signal { | |
922 | name: "topChanged" |
|
957 | name: "topChanged" | |
923 | Parameter { name: "top"; type: "int" } |
|
958 | Parameter { name: "top"; type: "int" } | |
924 | Parameter { name: "bottom"; type: "int" } |
|
959 | Parameter { name: "bottom"; type: "int" } | |
925 | Parameter { name: "left"; type: "int" } |
|
960 | Parameter { name: "left"; type: "int" } | |
926 | Parameter { name: "right"; type: "int" } |
|
961 | Parameter { name: "right"; type: "int" } | |
927 | } |
|
962 | } | |
928 | Signal { |
|
963 | Signal { | |
929 | name: "bottomChanged" |
|
964 | name: "bottomChanged" | |
930 | Parameter { name: "top"; type: "int" } |
|
965 | Parameter { name: "top"; type: "int" } | |
931 | Parameter { name: "bottom"; type: "int" } |
|
966 | Parameter { name: "bottom"; type: "int" } | |
932 | Parameter { name: "left"; type: "int" } |
|
967 | Parameter { name: "left"; type: "int" } | |
933 | Parameter { name: "right"; type: "int" } |
|
968 | Parameter { name: "right"; type: "int" } | |
934 | } |
|
969 | } | |
935 | Signal { |
|
970 | Signal { | |
936 | name: "leftChanged" |
|
971 | name: "leftChanged" | |
937 | Parameter { name: "top"; type: "int" } |
|
972 | Parameter { name: "top"; type: "int" } | |
938 | Parameter { name: "bottom"; type: "int" } |
|
973 | Parameter { name: "bottom"; type: "int" } | |
939 | Parameter { name: "left"; type: "int" } |
|
974 | Parameter { name: "left"; type: "int" } | |
940 | Parameter { name: "right"; type: "int" } |
|
975 | Parameter { name: "right"; type: "int" } | |
941 | } |
|
976 | } | |
942 | Signal { |
|
977 | Signal { | |
943 | name: "rightChanged" |
|
978 | name: "rightChanged" | |
944 | Parameter { name: "top"; type: "int" } |
|
979 | Parameter { name: "top"; type: "int" } | |
945 | Parameter { name: "bottom"; type: "int" } |
|
980 | Parameter { name: "bottom"; type: "int" } | |
946 | Parameter { name: "left"; type: "int" } |
|
981 | Parameter { name: "left"; type: "int" } | |
947 | Parameter { name: "right"; type: "int" } |
|
982 | Parameter { name: "right"; type: "int" } | |
948 | } |
|
983 | } | |
949 | } |
|
984 | } | |
950 | Component { |
|
985 | Component { | |
951 | name: "QtCommercialChart::DeclarativePercentBarSeries" |
|
986 | name: "QtCommercialChart::DeclarativePercentBarSeries" | |
952 | defaultProperty: "seriesChildren" |
|
987 | defaultProperty: "seriesChildren" | |
953 | prototype: "QtCommercialChart::QPercentBarSeries" |
|
988 | prototype: "QtCommercialChart::QPercentBarSeries" | |
954 | exports: [ |
|
989 | exports: [ | |
955 | "QtCommercial.Chart/PercentBarSeries 1.0", |
|
990 | "QtCommercial.Chart/PercentBarSeries 1.0", | |
956 | "QtCommercial.Chart/PercentBarSeries 1.1", |
|
991 | "QtCommercial.Chart/PercentBarSeries 1.1", | |
957 | "QtCommercial.Chart/PercentBarSeries 1.2" |
|
992 | "QtCommercial.Chart/PercentBarSeries 1.2" | |
958 | ] |
|
993 | ] | |
959 | exportMetaObjectRevisions: [0, 1, 2] |
|
994 | exportMetaObjectRevisions: [0, 1, 2] | |
960 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
995 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
961 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
996 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
962 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
997 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
963 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
998 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
964 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
999 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
965 | Signal { |
|
1000 | Signal { | |
966 | name: "axisXChanged" |
|
1001 | name: "axisXChanged" | |
967 | revision: 1 |
|
1002 | revision: 1 | |
968 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1003 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
969 | } |
|
1004 | } | |
970 | Signal { |
|
1005 | Signal { | |
971 | name: "axisYChanged" |
|
1006 | name: "axisYChanged" | |
972 | revision: 1 |
|
1007 | revision: 1 | |
973 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1008 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
974 | } |
|
1009 | } | |
975 | Signal { |
|
1010 | Signal { | |
976 | name: "axisXTopChanged" |
|
1011 | name: "axisXTopChanged" | |
977 | revision: 2 |
|
1012 | revision: 2 | |
978 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1013 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
979 | } |
|
1014 | } | |
980 | Signal { |
|
1015 | Signal { | |
981 | name: "axisYRightChanged" |
|
1016 | name: "axisYRightChanged" | |
982 | revision: 2 |
|
1017 | revision: 2 | |
983 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1018 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
984 | } |
|
1019 | } | |
985 | Method { |
|
1020 | Method { | |
986 | name: "appendSeriesChildren" |
|
1021 | name: "appendSeriesChildren" | |
987 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1022 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
988 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1023 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
989 | } |
|
1024 | } | |
990 | Method { |
|
1025 | Method { | |
991 | name: "at" |
|
1026 | name: "at" | |
992 | type: "DeclarativeBarSet*" |
|
1027 | type: "DeclarativeBarSet*" | |
993 | Parameter { name: "index"; type: "int" } |
|
1028 | Parameter { name: "index"; type: "int" } | |
994 | } |
|
1029 | } | |
995 | Method { |
|
1030 | Method { | |
996 | name: "append" |
|
1031 | name: "append" | |
997 | type: "DeclarativeBarSet*" |
|
1032 | type: "DeclarativeBarSet*" | |
998 | Parameter { name: "label"; type: "string" } |
|
1033 | Parameter { name: "label"; type: "string" } | |
999 | Parameter { name: "values"; type: "QVariantList" } |
|
1034 | Parameter { name: "values"; type: "QVariantList" } | |
1000 | } |
|
1035 | } | |
1001 | Method { |
|
1036 | Method { | |
1002 | name: "insert" |
|
1037 | name: "insert" | |
1003 | type: "DeclarativeBarSet*" |
|
1038 | type: "DeclarativeBarSet*" | |
1004 | Parameter { name: "index"; type: "int" } |
|
1039 | Parameter { name: "index"; type: "int" } | |
1005 | Parameter { name: "label"; type: "string" } |
|
1040 | Parameter { name: "label"; type: "string" } | |
1006 | Parameter { name: "values"; type: "QVariantList" } |
|
1041 | Parameter { name: "values"; type: "QVariantList" } | |
1007 | } |
|
1042 | } | |
1008 | Method { |
|
1043 | Method { | |
1009 | name: "remove" |
|
1044 | name: "remove" | |
1010 | type: "bool" |
|
1045 | type: "bool" | |
1011 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1046 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1012 | } |
|
1047 | } | |
1013 | Method { name: "clear" } |
|
1048 | Method { name: "clear" } | |
1014 | } |
|
1049 | } | |
1015 | Component { |
|
1050 | Component { | |
1016 | name: "QtCommercialChart::DeclarativePieSeries" |
|
1051 | name: "QtCommercialChart::DeclarativePieSeries" | |
1017 | defaultProperty: "seriesChildren" |
|
1052 | defaultProperty: "seriesChildren" | |
1018 | prototype: "QtCommercialChart::QPieSeries" |
|
1053 | prototype: "QtCommercialChart::QPieSeries" | |
1019 | exports: [ |
|
1054 | exports: [ | |
1020 | "QtCommercial.Chart/PieSeries 1.0", |
|
1055 | "QtCommercial.Chart/PieSeries 1.0", | |
1021 | "QtCommercial.Chart/PieSeries 1.1" |
|
1056 | "QtCommercial.Chart/PieSeries 1.1" | |
1022 | ] |
|
1057 | ] | |
1023 | exportMetaObjectRevisions: [0, 0] |
|
1058 | exportMetaObjectRevisions: [0, 0] | |
1024 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1059 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1025 | Signal { |
|
1060 | Signal { | |
1026 | name: "sliceAdded" |
|
1061 | name: "sliceAdded" | |
1027 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1062 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1028 | } |
|
1063 | } | |
1029 | Signal { |
|
1064 | Signal { | |
1030 | name: "sliceRemoved" |
|
1065 | name: "sliceRemoved" | |
1031 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1066 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1032 | } |
|
1067 | } | |
1033 | Method { |
|
1068 | Method { | |
1034 | name: "appendSeriesChildren" |
|
1069 | name: "appendSeriesChildren" | |
1035 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1070 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1036 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1071 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1037 | } |
|
1072 | } | |
1038 | Method { |
|
1073 | Method { | |
1039 | name: "handleAdded" |
|
1074 | name: "handleAdded" | |
1040 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
1075 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
1041 | } |
|
1076 | } | |
1042 | Method { |
|
1077 | Method { | |
1043 | name: "handleRemoved" |
|
1078 | name: "handleRemoved" | |
1044 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
1079 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
1045 | } |
|
1080 | } | |
1046 | Method { |
|
1081 | Method { | |
1047 | name: "at" |
|
1082 | name: "at" | |
1048 | type: "QPieSlice*" |
|
1083 | type: "QPieSlice*" | |
1049 | Parameter { name: "index"; type: "int" } |
|
1084 | Parameter { name: "index"; type: "int" } | |
1050 | } |
|
1085 | } | |
1051 | Method { |
|
1086 | Method { | |
1052 | name: "find" |
|
1087 | name: "find" | |
1053 | type: "QPieSlice*" |
|
1088 | type: "QPieSlice*" | |
1054 | Parameter { name: "label"; type: "string" } |
|
1089 | Parameter { name: "label"; type: "string" } | |
1055 | } |
|
1090 | } | |
1056 | Method { |
|
1091 | Method { | |
1057 | name: "append" |
|
1092 | name: "append" | |
1058 |
type: " |
|
1093 | type: "DeclarativePieSlice*" | |
1059 | Parameter { name: "label"; type: "string" } |
|
1094 | Parameter { name: "label"; type: "string" } | |
1060 | Parameter { name: "value"; type: "double" } |
|
1095 | Parameter { name: "value"; type: "double" } | |
1061 | } |
|
1096 | } | |
1062 | Method { |
|
1097 | Method { | |
1063 | name: "remove" |
|
1098 | name: "remove" | |
1064 | type: "bool" |
|
1099 | type: "bool" | |
1065 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1100 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1066 | } |
|
1101 | } | |
1067 | Method { name: "clear" } |
|
1102 | Method { name: "clear" } | |
1068 | } |
|
1103 | } | |
1069 | Component { |
|
1104 | Component { | |
|
1105 | name: "QtCommercialChart::DeclarativePieSlice" | |||
|
1106 | prototype: "QtCommercialChart::QPieSlice" | |||
|
1107 | exports: ["QtCommercial.Chart/PieSlice 1.4"] | |||
|
1108 | exportMetaObjectRevisions: [0] | |||
|
1109 | Property { name: "brushFilename"; type: "string" } | |||
|
1110 | Signal { | |||
|
1111 | name: "brushFilenameChanged" | |||
|
1112 | Parameter { name: "brushFilename"; type: "string" } | |||
|
1113 | } | |||
|
1114 | } | |||
|
1115 | Component { | |||
1070 | name: "QtCommercialChart::DeclarativePolarChart" |
|
1116 | name: "QtCommercialChart::DeclarativePolarChart" | |
1071 | defaultProperty: "data" |
|
1117 | defaultProperty: "data" | |
1072 | prototype: "QtCommercialChart::DeclarativeChart" |
|
1118 | prototype: "QtCommercialChart::DeclarativeChart" | |
1073 | exports: ["QtCommercial.Chart/PolarChartView 1.3"] |
|
1119 | exports: ["QtCommercial.Chart/PolarChartView 1.3"] | |
1074 | exportMetaObjectRevisions: [1] |
|
1120 | exportMetaObjectRevisions: [1] | |
1075 | } |
|
1121 | } | |
1076 | Component { |
|
1122 | Component { | |
1077 | name: "QtCommercialChart::DeclarativeScatterSeries" |
|
1123 | name: "QtCommercialChart::DeclarativeScatterSeries" | |
1078 | defaultProperty: "declarativeChildren" |
|
1124 | defaultProperty: "declarativeChildren" | |
1079 | prototype: "QtCommercialChart::QScatterSeries" |
|
1125 | prototype: "QtCommercialChart::QScatterSeries" | |
1080 | exports: [ |
|
1126 | exports: [ | |
1081 | "QtCommercial.Chart/ScatterSeries 1.0", |
|
1127 | "QtCommercial.Chart/ScatterSeries 1.0", | |
1082 | "QtCommercial.Chart/ScatterSeries 1.1", |
|
1128 | "QtCommercial.Chart/ScatterSeries 1.1", | |
1083 | "QtCommercial.Chart/ScatterSeries 1.2", |
|
1129 | "QtCommercial.Chart/ScatterSeries 1.2", | |
1084 | "QtCommercial.Chart/ScatterSeries 1.3" |
|
1130 | "QtCommercial.Chart/ScatterSeries 1.3", | |
|
1131 | "QtCommercial.Chart/ScatterSeries 1.4" | |||
1085 | ] |
|
1132 | ] | |
1086 | exportMetaObjectRevisions: [0, 1, 2, 3] |
|
1133 | exportMetaObjectRevisions: [0, 1, 2, 3, 4] | |
1087 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1134 | Property { name: "count"; type: "int"; isReadonly: true } | |
1088 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1135 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1089 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1136 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1090 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1137 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1091 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1138 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1092 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1139 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1093 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1140 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1094 | Property { name: "borderWidth"; revision: 1; type: "double" } |
|
1141 | Property { name: "borderWidth"; revision: 1; type: "double" } | |
1095 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1142 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } | |
|
1143 | Property { name: "brushFilename"; revision: 4; type: "string" } | |||
|
1144 | Property { name: "brush"; revision: 4; type: "QBrush" } | |||
1096 | Signal { |
|
1145 | Signal { | |
1097 | name: "countChanged" |
|
1146 | name: "countChanged" | |
1098 | Parameter { name: "count"; type: "int" } |
|
1147 | Parameter { name: "count"; type: "int" } | |
1099 | } |
|
1148 | } | |
1100 | Signal { |
|
1149 | Signal { | |
1101 | name: "axisXChanged" |
|
1150 | name: "axisXChanged" | |
1102 | revision: 1 |
|
1151 | revision: 1 | |
1103 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1152 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1104 | } |
|
1153 | } | |
1105 | Signal { |
|
1154 | Signal { | |
1106 | name: "axisYChanged" |
|
1155 | name: "axisYChanged" | |
1107 | revision: 1 |
|
1156 | revision: 1 | |
1108 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1157 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1109 | } |
|
1158 | } | |
1110 | Signal { |
|
1159 | Signal { | |
1111 | name: "borderWidthChanged" |
|
1160 | name: "borderWidthChanged" | |
1112 | revision: 1 |
|
1161 | revision: 1 | |
1113 | Parameter { name: "width"; type: "double" } |
|
1162 | Parameter { name: "width"; type: "double" } | |
1114 | } |
|
1163 | } | |
1115 | Signal { |
|
1164 | Signal { | |
1116 | name: "axisXTopChanged" |
|
1165 | name: "axisXTopChanged" | |
1117 | revision: 2 |
|
1166 | revision: 2 | |
1118 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1167 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1119 | } |
|
1168 | } | |
1120 | Signal { |
|
1169 | Signal { | |
1121 | name: "axisYRightChanged" |
|
1170 | name: "axisYRightChanged" | |
1122 | revision: 2 |
|
1171 | revision: 2 | |
1123 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1172 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1124 | } |
|
1173 | } | |
1125 | Signal { |
|
1174 | Signal { | |
1126 | name: "axisAngularChanged" |
|
1175 | name: "axisAngularChanged" | |
1127 | revision: 3 |
|
1176 | revision: 3 | |
1128 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1177 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1129 | } |
|
1178 | } | |
1130 | Signal { |
|
1179 | Signal { | |
1131 | name: "axisRadialChanged" |
|
1180 | name: "axisRadialChanged" | |
1132 | revision: 3 |
|
1181 | revision: 3 | |
1133 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1182 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1134 | } |
|
1183 | } | |
|
1184 | Signal { | |||
|
1185 | name: "brushFilenameChanged" | |||
|
1186 | revision: 4 | |||
|
1187 | Parameter { name: "brushFilename"; type: "string" } | |||
|
1188 | } | |||
|
1189 | Signal { name: "brushChanged"; revision: 4 } | |||
1135 | Method { |
|
1190 | Method { | |
1136 | name: "appendDeclarativeChildren" |
|
1191 | name: "appendDeclarativeChildren" | |
1137 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1192 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1138 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1193 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1139 | } |
|
1194 | } | |
1140 | Method { |
|
1195 | Method { | |
1141 | name: "handleCountChanged" |
|
1196 | name: "handleCountChanged" | |
1142 | Parameter { name: "index"; type: "int" } |
|
1197 | Parameter { name: "index"; type: "int" } | |
1143 | } |
|
1198 | } | |
1144 | Method { |
|
1199 | Method { | |
1145 | name: "append" |
|
1200 | name: "append" | |
1146 | Parameter { name: "x"; type: "double" } |
|
1201 | Parameter { name: "x"; type: "double" } | |
1147 | Parameter { name: "y"; type: "double" } |
|
1202 | Parameter { name: "y"; type: "double" } | |
1148 | } |
|
1203 | } | |
1149 | Method { |
|
1204 | Method { | |
1150 | name: "replace" |
|
1205 | name: "replace" | |
1151 | Parameter { name: "oldX"; type: "double" } |
|
1206 | Parameter { name: "oldX"; type: "double" } | |
1152 | Parameter { name: "oldY"; type: "double" } |
|
1207 | Parameter { name: "oldY"; type: "double" } | |
1153 | Parameter { name: "newX"; type: "double" } |
|
1208 | Parameter { name: "newX"; type: "double" } | |
1154 | Parameter { name: "newY"; type: "double" } |
|
1209 | Parameter { name: "newY"; type: "double" } | |
1155 | } |
|
1210 | } | |
1156 | Method { |
|
1211 | Method { | |
1157 | name: "replace" |
|
1212 | name: "replace" | |
1158 | revision: 3 |
|
1213 | revision: 3 | |
1159 | Parameter { name: "index"; type: "int" } |
|
1214 | Parameter { name: "index"; type: "int" } | |
1160 | Parameter { name: "newX"; type: "double" } |
|
1215 | Parameter { name: "newX"; type: "double" } | |
1161 | Parameter { name: "newY"; type: "double" } |
|
1216 | Parameter { name: "newY"; type: "double" } | |
1162 | } |
|
1217 | } | |
1163 | Method { |
|
1218 | Method { | |
1164 | name: "remove" |
|
1219 | name: "remove" | |
1165 | Parameter { name: "x"; type: "double" } |
|
1220 | Parameter { name: "x"; type: "double" } | |
1166 | Parameter { name: "y"; type: "double" } |
|
1221 | Parameter { name: "y"; type: "double" } | |
1167 | } |
|
1222 | } | |
1168 | Method { |
|
1223 | Method { | |
1169 | name: "remove" |
|
1224 | name: "remove" | |
1170 | revision: 3 |
|
1225 | revision: 3 | |
1171 | Parameter { name: "index"; type: "int" } |
|
1226 | Parameter { name: "index"; type: "int" } | |
1172 | } |
|
1227 | } | |
1173 | Method { |
|
1228 | Method { | |
1174 | name: "insert" |
|
1229 | name: "insert" | |
1175 | Parameter { name: "index"; type: "int" } |
|
1230 | Parameter { name: "index"; type: "int" } | |
1176 | Parameter { name: "x"; type: "double" } |
|
1231 | Parameter { name: "x"; type: "double" } | |
1177 | Parameter { name: "y"; type: "double" } |
|
1232 | Parameter { name: "y"; type: "double" } | |
1178 | } |
|
1233 | } | |
1179 | Method { name: "clear" } |
|
1234 | Method { name: "clear" } | |
1180 | Method { |
|
1235 | Method { | |
1181 | name: "at" |
|
1236 | name: "at" | |
1182 | type: "QPointF" |
|
1237 | type: "QPointF" | |
1183 | Parameter { name: "index"; type: "int" } |
|
1238 | Parameter { name: "index"; type: "int" } | |
1184 | } |
|
1239 | } | |
1185 | } |
|
1240 | } | |
1186 | Component { |
|
1241 | Component { | |
1187 | name: "QtCommercialChart::DeclarativeSplineSeries" |
|
1242 | name: "QtCommercialChart::DeclarativeSplineSeries" | |
1188 | defaultProperty: "declarativeChildren" |
|
1243 | defaultProperty: "declarativeChildren" | |
1189 | prototype: "QtCommercialChart::QSplineSeries" |
|
1244 | prototype: "QtCommercialChart::QSplineSeries" | |
1190 | exports: [ |
|
1245 | exports: [ | |
1191 | "QtCommercial.Chart/SplineSeries 1.0", |
|
1246 | "QtCommercial.Chart/SplineSeries 1.0", | |
1192 | "QtCommercial.Chart/SplineSeries 1.1", |
|
1247 | "QtCommercial.Chart/SplineSeries 1.1", | |
1193 | "QtCommercial.Chart/SplineSeries 1.2", |
|
1248 | "QtCommercial.Chart/SplineSeries 1.2", | |
1194 | "QtCommercial.Chart/SplineSeries 1.3" |
|
1249 | "QtCommercial.Chart/SplineSeries 1.3" | |
1195 | ] |
|
1250 | ] | |
1196 | exportMetaObjectRevisions: [0, 1, 2, 3] |
|
1251 | exportMetaObjectRevisions: [0, 1, 2, 3] | |
1197 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1252 | Property { name: "count"; type: "int"; isReadonly: true } | |
1198 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1253 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1199 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1254 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1200 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1255 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1201 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1256 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1202 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1257 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1203 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1258 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1204 | Property { name: "width"; revision: 1; type: "double" } |
|
1259 | Property { name: "width"; revision: 1; type: "double" } | |
1205 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } |
|
1260 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } | |
1206 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } |
|
1261 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } | |
1207 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1262 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1208 | Signal { |
|
1263 | Signal { | |
1209 | name: "countChanged" |
|
1264 | name: "countChanged" | |
1210 | Parameter { name: "count"; type: "int" } |
|
1265 | Parameter { name: "count"; type: "int" } | |
1211 | } |
|
1266 | } | |
1212 | Signal { |
|
1267 | Signal { | |
1213 | name: "axisXChanged" |
|
1268 | name: "axisXChanged" | |
1214 | revision: 1 |
|
1269 | revision: 1 | |
1215 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1270 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1216 | } |
|
1271 | } | |
1217 | Signal { |
|
1272 | Signal { | |
1218 | name: "axisYChanged" |
|
1273 | name: "axisYChanged" | |
1219 | revision: 1 |
|
1274 | revision: 1 | |
1220 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1275 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1221 | } |
|
1276 | } | |
1222 | Signal { |
|
1277 | Signal { | |
1223 | name: "axisXTopChanged" |
|
1278 | name: "axisXTopChanged" | |
1224 | revision: 2 |
|
1279 | revision: 2 | |
1225 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1280 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1226 | } |
|
1281 | } | |
1227 | Signal { |
|
1282 | Signal { | |
1228 | name: "axisYRightChanged" |
|
1283 | name: "axisYRightChanged" | |
1229 | revision: 2 |
|
1284 | revision: 2 | |
1230 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1285 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1231 | } |
|
1286 | } | |
1232 | Signal { |
|
1287 | Signal { | |
1233 | name: "axisAngularChanged" |
|
1288 | name: "axisAngularChanged" | |
1234 | revision: 3 |
|
1289 | revision: 3 | |
1235 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1290 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1236 | } |
|
1291 | } | |
1237 | Signal { |
|
1292 | Signal { | |
1238 | name: "axisRadialChanged" |
|
1293 | name: "axisRadialChanged" | |
1239 | revision: 3 |
|
1294 | revision: 3 | |
1240 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1295 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1241 | } |
|
1296 | } | |
1242 | Signal { |
|
1297 | Signal { | |
1243 | name: "widthChanged" |
|
1298 | name: "widthChanged" | |
1244 | revision: 1 |
|
1299 | revision: 1 | |
1245 | Parameter { name: "width"; type: "double" } |
|
1300 | Parameter { name: "width"; type: "double" } | |
1246 | } |
|
1301 | } | |
1247 | Signal { |
|
1302 | Signal { | |
1248 | name: "styleChanged" |
|
1303 | name: "styleChanged" | |
1249 | revision: 1 |
|
1304 | revision: 1 | |
1250 | Parameter { name: "style"; type: "Qt::PenStyle" } |
|
1305 | Parameter { name: "style"; type: "Qt::PenStyle" } | |
1251 | } |
|
1306 | } | |
1252 | Signal { |
|
1307 | Signal { | |
1253 | name: "capStyleChanged" |
|
1308 | name: "capStyleChanged" | |
1254 | revision: 1 |
|
1309 | revision: 1 | |
1255 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } |
|
1310 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } | |
1256 | } |
|
1311 | } | |
1257 | Method { |
|
1312 | Method { | |
1258 | name: "appendDeclarativeChildren" |
|
1313 | name: "appendDeclarativeChildren" | |
1259 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1314 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1260 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1315 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1261 | } |
|
1316 | } | |
1262 | Method { |
|
1317 | Method { | |
1263 | name: "handleCountChanged" |
|
1318 | name: "handleCountChanged" | |
1264 | Parameter { name: "index"; type: "int" } |
|
1319 | Parameter { name: "index"; type: "int" } | |
1265 | } |
|
1320 | } | |
1266 | Method { |
|
1321 | Method { | |
1267 | name: "append" |
|
1322 | name: "append" | |
1268 | Parameter { name: "x"; type: "double" } |
|
1323 | Parameter { name: "x"; type: "double" } | |
1269 | Parameter { name: "y"; type: "double" } |
|
1324 | Parameter { name: "y"; type: "double" } | |
1270 | } |
|
1325 | } | |
1271 | Method { |
|
1326 | Method { | |
1272 | name: "replace" |
|
1327 | name: "replace" | |
1273 | Parameter { name: "oldX"; type: "double" } |
|
1328 | Parameter { name: "oldX"; type: "double" } | |
1274 | Parameter { name: "oldY"; type: "double" } |
|
1329 | Parameter { name: "oldY"; type: "double" } | |
1275 | Parameter { name: "newX"; type: "double" } |
|
1330 | Parameter { name: "newX"; type: "double" } | |
1276 | Parameter { name: "newY"; type: "double" } |
|
1331 | Parameter { name: "newY"; type: "double" } | |
1277 | } |
|
1332 | } | |
1278 | Method { |
|
1333 | Method { | |
1279 | name: "replace" |
|
1334 | name: "replace" | |
1280 | revision: 3 |
|
1335 | revision: 3 | |
1281 | Parameter { name: "index"; type: "int" } |
|
1336 | Parameter { name: "index"; type: "int" } | |
1282 | Parameter { name: "newX"; type: "double" } |
|
1337 | Parameter { name: "newX"; type: "double" } | |
1283 | Parameter { name: "newY"; type: "double" } |
|
1338 | Parameter { name: "newY"; type: "double" } | |
1284 | } |
|
1339 | } | |
1285 | Method { |
|
1340 | Method { | |
1286 | name: "remove" |
|
1341 | name: "remove" | |
1287 | Parameter { name: "x"; type: "double" } |
|
1342 | Parameter { name: "x"; type: "double" } | |
1288 | Parameter { name: "y"; type: "double" } |
|
1343 | Parameter { name: "y"; type: "double" } | |
1289 | } |
|
1344 | } | |
1290 | Method { |
|
1345 | Method { | |
1291 | name: "remove" |
|
1346 | name: "remove" | |
1292 | revision: 3 |
|
1347 | revision: 3 | |
1293 | Parameter { name: "index"; type: "int" } |
|
1348 | Parameter { name: "index"; type: "int" } | |
1294 | } |
|
1349 | } | |
1295 | Method { |
|
1350 | Method { | |
1296 | name: "insert" |
|
1351 | name: "insert" | |
1297 | Parameter { name: "index"; type: "int" } |
|
1352 | Parameter { name: "index"; type: "int" } | |
1298 | Parameter { name: "x"; type: "double" } |
|
1353 | Parameter { name: "x"; type: "double" } | |
1299 | Parameter { name: "y"; type: "double" } |
|
1354 | Parameter { name: "y"; type: "double" } | |
1300 | } |
|
1355 | } | |
1301 | Method { name: "clear" } |
|
1356 | Method { name: "clear" } | |
1302 | Method { |
|
1357 | Method { | |
1303 | name: "at" |
|
1358 | name: "at" | |
1304 | type: "QPointF" |
|
1359 | type: "QPointF" | |
1305 | Parameter { name: "index"; type: "int" } |
|
1360 | Parameter { name: "index"; type: "int" } | |
1306 | } |
|
1361 | } | |
1307 | } |
|
1362 | } | |
1308 | Component { |
|
1363 | Component { | |
1309 | name: "QtCommercialChart::DeclarativeStackedBarSeries" |
|
1364 | name: "QtCommercialChart::DeclarativeStackedBarSeries" | |
1310 | defaultProperty: "seriesChildren" |
|
1365 | defaultProperty: "seriesChildren" | |
1311 | prototype: "QtCommercialChart::QStackedBarSeries" |
|
1366 | prototype: "QtCommercialChart::QStackedBarSeries" | |
1312 | exports: [ |
|
1367 | exports: [ | |
1313 | "QtCommercial.Chart/StackedBarSeries 1.0", |
|
1368 | "QtCommercial.Chart/StackedBarSeries 1.0", | |
1314 | "QtCommercial.Chart/StackedBarSeries 1.1", |
|
1369 | "QtCommercial.Chart/StackedBarSeries 1.1", | |
1315 | "QtCommercial.Chart/StackedBarSeries 1.2" |
|
1370 | "QtCommercial.Chart/StackedBarSeries 1.2" | |
1316 | ] |
|
1371 | ] | |
1317 | exportMetaObjectRevisions: [0, 1, 2] |
|
1372 | exportMetaObjectRevisions: [0, 1, 2] | |
1318 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1373 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1319 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1374 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1320 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1375 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1321 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1376 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1322 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1377 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1323 | Signal { |
|
1378 | Signal { | |
1324 | name: "axisXChanged" |
|
1379 | name: "axisXChanged" | |
1325 | revision: 1 |
|
1380 | revision: 1 | |
1326 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1381 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1327 | } |
|
1382 | } | |
1328 | Signal { |
|
1383 | Signal { | |
1329 | name: "axisYChanged" |
|
1384 | name: "axisYChanged" | |
1330 | revision: 1 |
|
1385 | revision: 1 | |
1331 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1386 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1332 | } |
|
1387 | } | |
1333 | Signal { |
|
1388 | Signal { | |
1334 | name: "axisXTopChanged" |
|
1389 | name: "axisXTopChanged" | |
1335 | revision: 2 |
|
1390 | revision: 2 | |
1336 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1391 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1337 | } |
|
1392 | } | |
1338 | Signal { |
|
1393 | Signal { | |
1339 | name: "axisYRightChanged" |
|
1394 | name: "axisYRightChanged" | |
1340 | revision: 2 |
|
1395 | revision: 2 | |
1341 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1396 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1342 | } |
|
1397 | } | |
1343 | Method { |
|
1398 | Method { | |
1344 | name: "appendSeriesChildren" |
|
1399 | name: "appendSeriesChildren" | |
1345 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1400 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1346 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1401 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1347 | } |
|
1402 | } | |
1348 | Method { |
|
1403 | Method { | |
1349 | name: "at" |
|
1404 | name: "at" | |
1350 | type: "DeclarativeBarSet*" |
|
1405 | type: "DeclarativeBarSet*" | |
1351 | Parameter { name: "index"; type: "int" } |
|
1406 | Parameter { name: "index"; type: "int" } | |
1352 | } |
|
1407 | } | |
1353 | Method { |
|
1408 | Method { | |
1354 | name: "append" |
|
1409 | name: "append" | |
1355 | type: "DeclarativeBarSet*" |
|
1410 | type: "DeclarativeBarSet*" | |
1356 | Parameter { name: "label"; type: "string" } |
|
1411 | Parameter { name: "label"; type: "string" } | |
1357 | Parameter { name: "values"; type: "QVariantList" } |
|
1412 | Parameter { name: "values"; type: "QVariantList" } | |
1358 | } |
|
1413 | } | |
1359 | Method { |
|
1414 | Method { | |
1360 | name: "insert" |
|
1415 | name: "insert" | |
1361 | type: "DeclarativeBarSet*" |
|
1416 | type: "DeclarativeBarSet*" | |
1362 | Parameter { name: "index"; type: "int" } |
|
1417 | Parameter { name: "index"; type: "int" } | |
1363 | Parameter { name: "label"; type: "string" } |
|
1418 | Parameter { name: "label"; type: "string" } | |
1364 | Parameter { name: "values"; type: "QVariantList" } |
|
1419 | Parameter { name: "values"; type: "QVariantList" } | |
1365 | } |
|
1420 | } | |
1366 | Method { |
|
1421 | Method { | |
1367 | name: "remove" |
|
1422 | name: "remove" | |
1368 | type: "bool" |
|
1423 | type: "bool" | |
1369 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1424 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1370 | } |
|
1425 | } | |
1371 | Method { name: "clear" } |
|
1426 | Method { name: "clear" } | |
1372 | } |
|
1427 | } | |
1373 | Component { |
|
1428 | Component { | |
1374 | name: "QtCommercialChart::DeclarativeXYPoint" |
|
1429 | name: "QtCommercialChart::DeclarativeXYPoint" | |
1375 | prototype: "QObject" |
|
1430 | prototype: "QObject" | |
1376 | exports: ["QtCommercial.Chart/XYPoint 1.0"] |
|
1431 | exports: ["QtCommercial.Chart/XYPoint 1.0"] | |
1377 | exportMetaObjectRevisions: [0] |
|
1432 | exportMetaObjectRevisions: [0] | |
1378 | Property { name: "x"; type: "double" } |
|
1433 | Property { name: "x"; type: "double" } | |
1379 | Property { name: "y"; type: "double" } |
|
1434 | Property { name: "y"; type: "double" } | |
1380 | } |
|
1435 | } | |
1381 | Component { |
|
1436 | Component { | |
1382 | name: "QtCommercialChart::LegendScroller" |
|
1437 | name: "QtCommercialChart::LegendScroller" | |
1383 | defaultProperty: "children" |
|
1438 | defaultProperty: "children" | |
1384 | prototype: "QtCommercialChart::QLegend" |
|
1439 | prototype: "QtCommercialChart::QLegend" | |
1385 | } |
|
1440 | } | |
1386 | Component { |
|
1441 | Component { | |
1387 | name: "QtCommercialChart::QAbstractAxis" |
|
1442 | name: "QtCommercialChart::QAbstractAxis" | |
1388 | prototype: "QObject" |
|
1443 | prototype: "QObject" | |
1389 | exports: ["QtCommercial.Chart/AbstractAxis 1.0"] |
|
1444 | exports: ["QtCommercial.Chart/AbstractAxis 1.0"] | |
1390 | isCreatable: false |
|
|||
1391 | exportMetaObjectRevisions: [0] |
|
1445 | exportMetaObjectRevisions: [0] | |
1392 | Property { name: "visible"; type: "bool" } |
|
1446 | Property { name: "visible"; type: "bool" } | |
1393 | Property { name: "lineVisible"; type: "bool" } |
|
1447 | Property { name: "lineVisible"; type: "bool" } | |
1394 | Property { name: "linePen"; type: "QPen" } |
|
1448 | Property { name: "linePen"; type: "QPen" } | |
1395 | Property { name: "color"; type: "QColor" } |
|
1449 | Property { name: "color"; type: "QColor" } | |
1396 | Property { name: "labelsVisible"; type: "bool" } |
|
1450 | Property { name: "labelsVisible"; type: "bool" } | |
1397 | Property { name: "labelsPen"; type: "QPen" } |
|
1451 | Property { name: "labelsPen"; type: "QPen" } | |
1398 | Property { name: "labelsBrush"; type: "QBrush" } |
|
1452 | Property { name: "labelsBrush"; type: "QBrush" } | |
1399 | Property { name: "labelsAngle"; type: "int" } |
|
1453 | Property { name: "labelsAngle"; type: "int" } | |
1400 | Property { name: "labelsFont"; type: "QFont" } |
|
1454 | Property { name: "labelsFont"; type: "QFont" } | |
1401 | Property { name: "labelsColor"; type: "QColor" } |
|
1455 | Property { name: "labelsColor"; type: "QColor" } | |
1402 | Property { name: "gridVisible"; type: "bool" } |
|
1456 | Property { name: "gridVisible"; type: "bool" } | |
1403 | Property { name: "gridLinePen"; type: "QPen" } |
|
1457 | Property { name: "gridLinePen"; type: "QPen" } | |
1404 | Property { name: "shadesVisible"; type: "bool" } |
|
1458 | Property { name: "shadesVisible"; type: "bool" } | |
1405 | Property { name: "shadesColor"; type: "QColor" } |
|
1459 | Property { name: "shadesColor"; type: "QColor" } | |
1406 | Property { name: "shadesBorderColor"; type: "QColor" } |
|
1460 | Property { name: "shadesBorderColor"; type: "QColor" } | |
1407 | Property { name: "shadesPen"; type: "QPen" } |
|
1461 | Property { name: "shadesPen"; type: "QPen" } | |
1408 | Property { name: "shadesBrush"; type: "QBrush" } |
|
1462 | Property { name: "shadesBrush"; type: "QBrush" } | |
1409 | Property { name: "titleText"; type: "string" } |
|
1463 | Property { name: "titleText"; type: "string" } | |
1410 | Property { name: "titlePen"; type: "QPen" } |
|
1464 | Property { name: "titlePen"; type: "QPen" } | |
1411 | Property { name: "titleBrush"; type: "QBrush" } |
|
1465 | Property { name: "titleBrush"; type: "QBrush" } | |
1412 | Property { name: "titleVisible"; type: "bool" } |
|
1466 | Property { name: "titleVisible"; type: "bool" } | |
1413 | Property { name: "titleFont"; type: "QFont" } |
|
1467 | Property { name: "titleFont"; type: "QFont" } | |
1414 | Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true } |
|
1468 | Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true } | |
1415 | Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true } |
|
1469 | Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true } | |
1416 | Signal { |
|
1470 | Signal { | |
1417 | name: "visibleChanged" |
|
1471 | name: "visibleChanged" | |
1418 | Parameter { name: "visible"; type: "bool" } |
|
1472 | Parameter { name: "visible"; type: "bool" } | |
1419 | } |
|
1473 | } | |
1420 | Signal { |
|
1474 | Signal { | |
1421 | name: "linePenChanged" |
|
1475 | name: "linePenChanged" | |
1422 | Parameter { name: "pen"; type: "QPen" } |
|
1476 | Parameter { name: "pen"; type: "QPen" } | |
1423 | } |
|
1477 | } | |
1424 | Signal { |
|
1478 | Signal { | |
1425 | name: "lineVisibleChanged" |
|
1479 | name: "lineVisibleChanged" | |
1426 | Parameter { name: "visible"; type: "bool" } |
|
1480 | Parameter { name: "visible"; type: "bool" } | |
1427 | } |
|
1481 | } | |
1428 | Signal { |
|
1482 | Signal { | |
1429 | name: "labelsVisibleChanged" |
|
1483 | name: "labelsVisibleChanged" | |
1430 | Parameter { name: "visible"; type: "bool" } |
|
1484 | Parameter { name: "visible"; type: "bool" } | |
1431 | } |
|
1485 | } | |
1432 | Signal { |
|
1486 | Signal { | |
1433 | name: "labelsPenChanged" |
|
1487 | name: "labelsPenChanged" | |
1434 | Parameter { name: "pen"; type: "QPen" } |
|
1488 | Parameter { name: "pen"; type: "QPen" } | |
1435 | } |
|
1489 | } | |
1436 | Signal { |
|
1490 | Signal { | |
1437 | name: "labelsBrushChanged" |
|
1491 | name: "labelsBrushChanged" | |
1438 | Parameter { name: "brush"; type: "QBrush" } |
|
1492 | Parameter { name: "brush"; type: "QBrush" } | |
1439 | } |
|
1493 | } | |
1440 | Signal { |
|
1494 | Signal { | |
1441 | name: "labelsFontChanged" |
|
1495 | name: "labelsFontChanged" | |
1442 | Parameter { name: "pen"; type: "QFont" } |
|
1496 | Parameter { name: "pen"; type: "QFont" } | |
1443 | } |
|
1497 | } | |
1444 | Signal { |
|
1498 | Signal { | |
1445 | name: "labelsAngleChanged" |
|
1499 | name: "labelsAngleChanged" | |
1446 | Parameter { name: "angle"; type: "int" } |
|
1500 | Parameter { name: "angle"; type: "int" } | |
1447 | } |
|
1501 | } | |
1448 | Signal { |
|
1502 | Signal { | |
1449 | name: "gridLinePenChanged" |
|
1503 | name: "gridLinePenChanged" | |
1450 | Parameter { name: "pen"; type: "QPen" } |
|
1504 | Parameter { name: "pen"; type: "QPen" } | |
1451 | } |
|
1505 | } | |
1452 | Signal { |
|
1506 | Signal { | |
1453 | name: "gridVisibleChanged" |
|
1507 | name: "gridVisibleChanged" | |
1454 | Parameter { name: "visible"; type: "bool" } |
|
1508 | Parameter { name: "visible"; type: "bool" } | |
1455 | } |
|
1509 | } | |
1456 | Signal { |
|
1510 | Signal { | |
1457 | name: "colorChanged" |
|
1511 | name: "colorChanged" | |
1458 | Parameter { name: "color"; type: "QColor" } |
|
1512 | Parameter { name: "color"; type: "QColor" } | |
1459 | } |
|
1513 | } | |
1460 | Signal { |
|
1514 | Signal { | |
1461 | name: "labelsColorChanged" |
|
1515 | name: "labelsColorChanged" | |
1462 | Parameter { name: "color"; type: "QColor" } |
|
1516 | Parameter { name: "color"; type: "QColor" } | |
1463 | } |
|
1517 | } | |
1464 | Signal { |
|
1518 | Signal { | |
1465 | name: "titleTextChanged" |
|
1519 | name: "titleTextChanged" | |
1466 | Parameter { name: "title"; type: "string" } |
|
1520 | Parameter { name: "title"; type: "string" } | |
1467 | } |
|
1521 | } | |
1468 | Signal { |
|
1522 | Signal { | |
1469 | name: "titlePenChanged" |
|
1523 | name: "titlePenChanged" | |
1470 | Parameter { name: "pen"; type: "QPen" } |
|
1524 | Parameter { name: "pen"; type: "QPen" } | |
1471 | } |
|
1525 | } | |
1472 | Signal { |
|
1526 | Signal { | |
1473 | name: "titleBrushChanged" |
|
1527 | name: "titleBrushChanged" | |
1474 | Parameter { name: "brush"; type: "QBrush" } |
|
1528 | Parameter { name: "brush"; type: "QBrush" } | |
1475 | } |
|
1529 | } | |
1476 | Signal { |
|
1530 | Signal { | |
1477 | name: "titleVisibleChanged" |
|
1531 | name: "titleVisibleChanged" | |
1478 | Parameter { name: "visible"; type: "bool" } |
|
1532 | Parameter { name: "visible"; type: "bool" } | |
1479 | } |
|
1533 | } | |
1480 | Signal { |
|
1534 | Signal { | |
1481 | name: "titleFontChanged" |
|
1535 | name: "titleFontChanged" | |
1482 | Parameter { name: "font"; type: "QFont" } |
|
1536 | Parameter { name: "font"; type: "QFont" } | |
1483 | } |
|
1537 | } | |
1484 | Signal { |
|
1538 | Signal { | |
1485 | name: "shadesVisibleChanged" |
|
1539 | name: "shadesVisibleChanged" | |
1486 | Parameter { name: "visible"; type: "bool" } |
|
1540 | Parameter { name: "visible"; type: "bool" } | |
1487 | } |
|
1541 | } | |
1488 | Signal { |
|
1542 | Signal { | |
1489 | name: "shadesColorChanged" |
|
1543 | name: "shadesColorChanged" | |
1490 | Parameter { name: "color"; type: "QColor" } |
|
1544 | Parameter { name: "color"; type: "QColor" } | |
1491 | } |
|
1545 | } | |
1492 | Signal { |
|
1546 | Signal { | |
1493 | name: "shadesBorderColorChanged" |
|
1547 | name: "shadesBorderColorChanged" | |
1494 | Parameter { name: "color"; type: "QColor" } |
|
1548 | Parameter { name: "color"; type: "QColor" } | |
1495 | } |
|
1549 | } | |
1496 | Signal { |
|
1550 | Signal { | |
1497 | name: "shadesPenChanged" |
|
1551 | name: "shadesPenChanged" | |
1498 | Parameter { name: "pen"; type: "QPen" } |
|
1552 | Parameter { name: "pen"; type: "QPen" } | |
1499 | } |
|
1553 | } | |
1500 | Signal { |
|
1554 | Signal { | |
1501 | name: "shadesBrushChanged" |
|
1555 | name: "shadesBrushChanged" | |
1502 | Parameter { name: "brush"; type: "QBrush" } |
|
1556 | Parameter { name: "brush"; type: "QBrush" } | |
1503 | } |
|
1557 | } | |
1504 | } |
|
1558 | } | |
1505 | Component { |
|
1559 | Component { | |
1506 | name: "QtCommercialChart::QAbstractBarSeries" |
|
1560 | name: "QtCommercialChart::QAbstractBarSeries" | |
1507 | prototype: "QtCommercialChart::QAbstractSeries" |
|
1561 | prototype: "QtCommercialChart::QAbstractSeries" | |
1508 | exports: ["QtCommercial.Chart/AbstractBarSeries 1.0"] |
|
1562 | exports: ["QtCommercial.Chart/AbstractBarSeries 1.0"] | |
1509 | isCreatable: false |
|
|||
1510 | exportMetaObjectRevisions: [0] |
|
1563 | exportMetaObjectRevisions: [0] | |
1511 | Property { name: "barWidth"; type: "double" } |
|
1564 | Property { name: "barWidth"; type: "double" } | |
1512 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1565 | Property { name: "count"; type: "int"; isReadonly: true } | |
1513 | Property { name: "labelsVisible"; type: "bool" } |
|
1566 | Property { name: "labelsVisible"; type: "bool" } | |
1514 | Signal { |
|
1567 | Signal { | |
1515 | name: "clicked" |
|
1568 | name: "clicked" | |
1516 | Parameter { name: "index"; type: "int" } |
|
1569 | Parameter { name: "index"; type: "int" } | |
1517 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1570 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1518 | } |
|
1571 | } | |
1519 | Signal { |
|
1572 | Signal { | |
1520 | name: "hovered" |
|
1573 | name: "hovered" | |
1521 | Parameter { name: "status"; type: "bool" } |
|
1574 | Parameter { name: "status"; type: "bool" } | |
1522 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1575 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1523 | } |
|
1576 | } | |
1524 | Signal { |
|
1577 | Signal { | |
1525 | name: "hovered" |
|
1578 | name: "hovered" | |
1526 | Parameter { name: "status"; type: "bool" } |
|
1579 | Parameter { name: "status"; type: "bool" } | |
1527 | Parameter { name: "index"; type: "int" } |
|
1580 | Parameter { name: "index"; type: "int" } | |
1528 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1581 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1529 | } |
|
1582 | } | |
1530 | Signal { |
|
1583 | Signal { | |
1531 | name: "barsetsAdded" |
|
1584 | name: "barsetsAdded" | |
1532 | Parameter { name: "sets"; type: "QList<QBarSet*>" } |
|
1585 | Parameter { name: "sets"; type: "QList<QBarSet*>" } | |
1533 | } |
|
1586 | } | |
1534 | Signal { |
|
1587 | Signal { | |
1535 | name: "barsetsRemoved" |
|
1588 | name: "barsetsRemoved" | |
1536 | Parameter { name: "sets"; type: "QList<QBarSet*>" } |
|
1589 | Parameter { name: "sets"; type: "QList<QBarSet*>" } | |
1537 | } |
|
1590 | } | |
1538 | } |
|
1591 | } | |
1539 | Component { |
|
1592 | Component { | |
1540 | name: "QtCommercialChart::QAbstractSeries" |
|
1593 | name: "QtCommercialChart::QAbstractSeries" | |
1541 | prototype: "QObject" |
|
1594 | prototype: "QObject" | |
1542 | exports: ["QtCommercial.Chart/AbstractSeries 1.0"] |
|
1595 | exports: ["QtCommercial.Chart/AbstractSeries 1.0"] | |
1543 | isCreatable: false |
|
|||
1544 | exportMetaObjectRevisions: [0] |
|
1596 | exportMetaObjectRevisions: [0] | |
1545 | Enum { |
|
1597 | Enum { | |
1546 | name: "SeriesType" |
|
1598 | name: "SeriesType" | |
1547 | values: { |
|
1599 | values: { | |
1548 | "SeriesTypeLine": 0, |
|
1600 | "SeriesTypeLine": 0, | |
1549 | "SeriesTypeArea": 1, |
|
1601 | "SeriesTypeArea": 1, | |
1550 | "SeriesTypeBar": 2, |
|
1602 | "SeriesTypeBar": 2, | |
1551 | "SeriesTypeStackedBar": 3, |
|
1603 | "SeriesTypeStackedBar": 3, | |
1552 | "SeriesTypePercentBar": 4, |
|
1604 | "SeriesTypePercentBar": 4, | |
1553 | "SeriesTypePie": 5, |
|
1605 | "SeriesTypePie": 5, | |
1554 | "SeriesTypeScatter": 6, |
|
1606 | "SeriesTypeScatter": 6, | |
1555 | "SeriesTypeSpline": 7, |
|
1607 | "SeriesTypeSpline": 7, | |
1556 | "SeriesTypeHorizontalBar": 8, |
|
1608 | "SeriesTypeHorizontalBar": 8, | |
1557 | "SeriesTypeHorizontalStackedBar": 9, |
|
1609 | "SeriesTypeHorizontalStackedBar": 9, | |
1558 | "SeriesTypeHorizontalPercentBar": 10, |
|
1610 | "SeriesTypeHorizontalPercentBar": 10, | |
1559 | "SeriesTypeBoxPlot": 11 |
|
1611 | "SeriesTypeBoxPlot": 11 | |
1560 | } |
|
1612 | } | |
1561 | } |
|
1613 | } | |
1562 | Property { name: "name"; type: "string" } |
|
1614 | Property { name: "name"; type: "string" } | |
1563 | Property { name: "visible"; type: "bool" } |
|
1615 | Property { name: "visible"; type: "bool" } | |
1564 | Property { name: "opacity"; type: "double" } |
|
1616 | Property { name: "opacity"; type: "double" } | |
1565 | Property { name: "type"; type: "SeriesType"; isReadonly: true } |
|
1617 | Property { name: "type"; type: "SeriesType"; isReadonly: true } | |
1566 | } |
|
1618 | } | |
1567 | Component { |
|
1619 | Component { | |
1568 | name: "QtCommercialChart::QAreaSeries" |
|
1620 | name: "QtCommercialChart::QAreaSeries" | |
1569 | prototype: "QtCommercialChart::QAbstractSeries" |
|
1621 | prototype: "QtCommercialChart::QAbstractSeries" | |
1570 | Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } |
|
1622 | Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } | |
1571 | Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } |
|
1623 | Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } | |
1572 | Property { name: "color"; type: "QColor" } |
|
1624 | Property { name: "color"; type: "QColor" } | |
1573 | Property { name: "borderColor"; type: "QColor" } |
|
1625 | Property { name: "borderColor"; type: "QColor" } | |
1574 | Signal { |
|
1626 | Signal { | |
1575 | name: "clicked" |
|
1627 | name: "clicked" | |
1576 | Parameter { name: "point"; type: "QPointF" } |
|
1628 | Parameter { name: "point"; type: "QPointF" } | |
1577 | } |
|
1629 | } | |
1578 | Signal { |
|
1630 | Signal { | |
1579 | name: "hovered" |
|
1631 | name: "hovered" | |
1580 | Parameter { name: "point"; type: "QPointF" } |
|
1632 | Parameter { name: "point"; type: "QPointF" } | |
1581 | Parameter { name: "state"; type: "bool" } |
|
1633 | Parameter { name: "state"; type: "bool" } | |
1582 | } |
|
1634 | } | |
1583 | Signal { name: "selected" } |
|
1635 | Signal { name: "selected" } | |
1584 | Signal { |
|
1636 | Signal { | |
1585 | name: "colorChanged" |
|
1637 | name: "colorChanged" | |
1586 | Parameter { name: "color"; type: "QColor" } |
|
1638 | Parameter { name: "color"; type: "QColor" } | |
1587 | } |
|
1639 | } | |
1588 | Signal { |
|
1640 | Signal { | |
1589 | name: "borderColorChanged" |
|
1641 | name: "borderColorChanged" | |
1590 | Parameter { name: "color"; type: "QColor" } |
|
1642 | Parameter { name: "color"; type: "QColor" } | |
1591 | } |
|
1643 | } | |
1592 | } |
|
1644 | } | |
1593 | Component { |
|
1645 | Component { | |
1594 | name: "QtCommercialChart::QBarCategoryAxis" |
|
1646 | name: "QtCommercialChart::QBarCategoryAxis" | |
1595 | prototype: "QtCommercialChart::QAbstractAxis" |
|
1647 | prototype: "QtCommercialChart::QAbstractAxis" | |
1596 | exports: [ |
|
1648 | exports: [ | |
1597 | "QtCommercial.Chart/BarCategoriesAxis 1.0", |
|
1649 | "QtCommercial.Chart/BarCategoriesAxis 1.0", | |
1598 | "QtCommercial.Chart/BarCategoryAxis 1.1" |
|
1650 | "QtCommercial.Chart/BarCategoryAxis 1.1" | |
1599 | ] |
|
1651 | ] | |
1600 | exportMetaObjectRevisions: [0, 0] |
|
1652 | exportMetaObjectRevisions: [0, 0] | |
1601 | Property { name: "categories"; type: "QStringList" } |
|
1653 | Property { name: "categories"; type: "QStringList" } | |
1602 | Property { name: "min"; type: "string" } |
|
1654 | Property { name: "min"; type: "string" } | |
1603 | Property { name: "max"; type: "string" } |
|
1655 | Property { name: "max"; type: "string" } | |
1604 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1656 | Property { name: "count"; type: "int"; isReadonly: true } | |
1605 | Signal { |
|
1657 | Signal { | |
1606 | name: "minChanged" |
|
1658 | name: "minChanged" | |
1607 | Parameter { name: "min"; type: "string" } |
|
1659 | Parameter { name: "min"; type: "string" } | |
1608 | } |
|
1660 | } | |
1609 | Signal { |
|
1661 | Signal { | |
1610 | name: "maxChanged" |
|
1662 | name: "maxChanged" | |
1611 | Parameter { name: "max"; type: "string" } |
|
1663 | Parameter { name: "max"; type: "string" } | |
1612 | } |
|
1664 | } | |
1613 | Signal { |
|
1665 | Signal { | |
1614 | name: "rangeChanged" |
|
1666 | name: "rangeChanged" | |
1615 | Parameter { name: "min"; type: "string" } |
|
1667 | Parameter { name: "min"; type: "string" } | |
1616 | Parameter { name: "max"; type: "string" } |
|
1668 | Parameter { name: "max"; type: "string" } | |
1617 | } |
|
1669 | } | |
1618 | } |
|
1670 | } | |
1619 | Component { |
|
1671 | Component { | |
1620 | name: "QtCommercialChart::QBarModelMapper" |
|
1672 | name: "QtCommercialChart::QBarModelMapper" | |
1621 | prototype: "QObject" |
|
1673 | prototype: "QObject" | |
1622 | exports: ["QtCommercial.Chart/BarModelMapper 1.0"] |
|
1674 | exports: ["QtCommercial.Chart/BarModelMapper 1.0"] | |
1623 | isCreatable: false |
|
|||
1624 | exportMetaObjectRevisions: [0] |
|
1675 | exportMetaObjectRevisions: [0] | |
1625 | } |
|
1676 | } | |
1626 | Component { |
|
1677 | Component { | |
1627 | name: "QtCommercialChart::QBarSeries" |
|
1678 | name: "QtCommercialChart::QBarSeries" | |
1628 | prototype: "QtCommercialChart::QAbstractBarSeries" |
|
1679 | prototype: "QtCommercialChart::QAbstractBarSeries" | |
1629 | } |
|
1680 | } | |
1630 | Component { |
|
1681 | Component { | |
1631 | name: "QtCommercialChart::QBarSet" |
|
1682 | name: "QtCommercialChart::QBarSet" | |
1632 | prototype: "QObject" |
|
1683 | prototype: "QObject" | |
1633 | exports: ["QtCommercial.Chart/BarSetBase 1.0"] |
|
1684 | exports: ["QtCommercial.Chart/BarSetBase 1.0"] | |
1634 | isCreatable: false |
|
|||
1635 | exportMetaObjectRevisions: [0] |
|
1685 | exportMetaObjectRevisions: [0] | |
1636 | Property { name: "label"; type: "string" } |
|
1686 | Property { name: "label"; type: "string" } | |
1637 | Property { name: "pen"; type: "QPen" } |
|
1687 | Property { name: "pen"; type: "QPen" } | |
1638 | Property { name: "brush"; type: "QBrush" } |
|
1688 | Property { name: "brush"; type: "QBrush" } | |
1639 | Property { name: "labelBrush"; type: "QBrush" } |
|
1689 | Property { name: "labelBrush"; type: "QBrush" } | |
1640 | Property { name: "labelFont"; type: "QFont" } |
|
1690 | Property { name: "labelFont"; type: "QFont" } | |
1641 | Property { name: "color"; type: "QColor" } |
|
1691 | Property { name: "color"; type: "QColor" } | |
1642 | Property { name: "borderColor"; type: "QColor" } |
|
1692 | Property { name: "borderColor"; type: "QColor" } | |
1643 | Property { name: "labelColor"; type: "QColor" } |
|
1693 | Property { name: "labelColor"; type: "QColor" } | |
1644 | Signal { |
|
1694 | Signal { | |
1645 | name: "clicked" |
|
1695 | name: "clicked" | |
1646 | Parameter { name: "index"; type: "int" } |
|
1696 | Parameter { name: "index"; type: "int" } | |
1647 | } |
|
1697 | } | |
1648 | Signal { |
|
1698 | Signal { | |
1649 | name: "hovered" |
|
1699 | name: "hovered" | |
1650 | Parameter { name: "status"; type: "bool" } |
|
1700 | Parameter { name: "status"; type: "bool" } | |
1651 | } |
|
1701 | } | |
1652 | Signal { |
|
1702 | Signal { | |
1653 | name: "hovered" |
|
1703 | name: "hovered" | |
1654 | Parameter { name: "status"; type: "bool" } |
|
1704 | Parameter { name: "status"; type: "bool" } | |
1655 | Parameter { name: "index"; type: "int" } |
|
1705 | Parameter { name: "index"; type: "int" } | |
1656 | } |
|
1706 | } | |
1657 | Signal { |
|
1707 | Signal { | |
1658 | name: "colorChanged" |
|
1708 | name: "colorChanged" | |
1659 | Parameter { name: "color"; type: "QColor" } |
|
1709 | Parameter { name: "color"; type: "QColor" } | |
1660 | } |
|
1710 | } | |
1661 | Signal { |
|
1711 | Signal { | |
1662 | name: "borderColorChanged" |
|
1712 | name: "borderColorChanged" | |
1663 | Parameter { name: "color"; type: "QColor" } |
|
1713 | Parameter { name: "color"; type: "QColor" } | |
1664 | } |
|
1714 | } | |
1665 | Signal { |
|
1715 | Signal { | |
1666 | name: "labelColorChanged" |
|
1716 | name: "labelColorChanged" | |
1667 | Parameter { name: "color"; type: "QColor" } |
|
1717 | Parameter { name: "color"; type: "QColor" } | |
1668 | } |
|
1718 | } | |
1669 | Signal { |
|
1719 | Signal { | |
1670 | name: "valuesAdded" |
|
1720 | name: "valuesAdded" | |
1671 | Parameter { name: "index"; type: "int" } |
|
1721 | Parameter { name: "index"; type: "int" } | |
1672 | Parameter { name: "count"; type: "int" } |
|
1722 | Parameter { name: "count"; type: "int" } | |
1673 | } |
|
1723 | } | |
1674 | Signal { |
|
1724 | Signal { | |
1675 | name: "valuesRemoved" |
|
1725 | name: "valuesRemoved" | |
1676 | Parameter { name: "index"; type: "int" } |
|
1726 | Parameter { name: "index"; type: "int" } | |
1677 | Parameter { name: "count"; type: "int" } |
|
1727 | Parameter { name: "count"; type: "int" } | |
1678 | } |
|
1728 | } | |
1679 | Signal { |
|
1729 | Signal { | |
1680 | name: "valueChanged" |
|
1730 | name: "valueChanged" | |
1681 | Parameter { name: "index"; type: "int" } |
|
1731 | Parameter { name: "index"; type: "int" } | |
1682 | } |
|
1732 | } | |
1683 | } |
|
1733 | } | |
1684 | Component { |
|
1734 | Component { | |
1685 | name: "QtCommercialChart::QBoxPlotSeries" |
|
1735 | name: "QtCommercialChart::QBoxPlotSeries" | |
1686 | prototype: "QtCommercialChart::QAbstractSeries" |
|
1736 | prototype: "QtCommercialChart::QAbstractSeries" | |
1687 | Property { name: "boxOutlineVisible"; type: "bool" } |
|
1737 | Property { name: "boxOutlineVisible"; type: "bool" } | |
1688 | Property { name: "boxWidth"; type: "double" } |
|
1738 | Property { name: "boxWidth"; type: "double" } | |
1689 | Property { name: "pen"; type: "QPen" } |
|
1739 | Property { name: "pen"; type: "QPen" } | |
1690 | Property { name: "brush"; type: "QBrush" } |
|
1740 | Property { name: "brush"; type: "QBrush" } | |
1691 | Signal { |
|
1741 | Signal { | |
1692 | name: "clicked" |
|
1742 | name: "clicked" | |
1693 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
1743 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
1694 | } |
|
1744 | } | |
1695 | Signal { |
|
1745 | Signal { | |
1696 | name: "hovered" |
|
1746 | name: "hovered" | |
1697 | Parameter { name: "status"; type: "bool" } |
|
1747 | Parameter { name: "status"; type: "bool" } | |
1698 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
1748 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
1699 | } |
|
1749 | } | |
1700 | Signal { name: "countChanged" } |
|
1750 | Signal { name: "countChanged" } | |
1701 | Signal { name: "boxOutlineVisibilityChanged" } |
|
1751 | Signal { name: "boxOutlineVisibilityChanged" } | |
1702 | Signal { |
|
1752 | Signal { | |
1703 | name: "boxsetsAdded" |
|
1753 | name: "boxsetsAdded" | |
1704 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } |
|
1754 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } | |
1705 | } |
|
1755 | } | |
1706 | Signal { |
|
1756 | Signal { | |
1707 | name: "boxsetsRemoved" |
|
1757 | name: "boxsetsRemoved" | |
1708 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } |
|
1758 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } | |
1709 | } |
|
1759 | } | |
1710 | } |
|
1760 | } | |
1711 | Component { |
|
1761 | Component { | |
1712 | name: "QtCommercialChart::QBoxSet" |
|
1762 | name: "QtCommercialChart::QBoxSet" | |
1713 | prototype: "QObject" |
|
1763 | prototype: "QObject" | |
1714 | Property { name: "pen"; type: "QPen" } |
|
1764 | Property { name: "pen"; type: "QPen" } | |
1715 | Property { name: "brush"; type: "QBrush" } |
|
1765 | Property { name: "brush"; type: "QBrush" } | |
1716 | Signal { name: "clicked" } |
|
1766 | Signal { name: "clicked" } | |
1717 | Signal { |
|
1767 | Signal { | |
1718 | name: "hovered" |
|
1768 | name: "hovered" | |
1719 | Parameter { name: "status"; type: "bool" } |
|
1769 | Parameter { name: "status"; type: "bool" } | |
1720 | } |
|
1770 | } | |
1721 | Signal { name: "valuesChanged" } |
|
1771 | Signal { name: "valuesChanged" } | |
1722 | Signal { |
|
1772 | Signal { | |
1723 | name: "valueChanged" |
|
1773 | name: "valueChanged" | |
1724 | Parameter { name: "index"; type: "int" } |
|
1774 | Parameter { name: "index"; type: "int" } | |
1725 | } |
|
1775 | } | |
1726 | Signal { name: "cleared" } |
|
1776 | Signal { name: "cleared" } | |
1727 | } |
|
1777 | } | |
1728 | Component { |
|
1778 | Component { | |
1729 | name: "QtCommercialChart::QCategoryAxis" |
|
1779 | name: "QtCommercialChart::QCategoryAxis" | |
1730 | prototype: "QtCommercialChart::QValueAxis" |
|
1780 | prototype: "QtCommercialChart::QValueAxis" | |
1731 | Property { name: "startValue"; type: "double" } |
|
1781 | Property { name: "startValue"; type: "double" } | |
1732 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1782 | Property { name: "count"; type: "int"; isReadonly: true } | |
1733 | Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true } |
|
1783 | Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true } | |
1734 | Signal { name: "categoriesChanged" } |
|
1784 | Signal { name: "categoriesChanged" } | |
1735 | } |
|
1785 | } | |
1736 | Component { |
|
1786 | Component { | |
1737 | name: "QtCommercialChart::QDateTimeAxis" |
|
1787 | name: "QtCommercialChart::QDateTimeAxis" | |
1738 | prototype: "QtCommercialChart::QAbstractAxis" |
|
1788 | prototype: "QtCommercialChart::QAbstractAxis" | |
1739 | exports: ["QtCommercial.Chart/DateTimeAxis 1.1"] |
|
1789 | exports: ["QtCommercial.Chart/DateTimeAxis 1.1"] | |
1740 | exportMetaObjectRevisions: [0] |
|
1790 | exportMetaObjectRevisions: [0] | |
1741 | Property { name: "tickCount"; type: "int" } |
|
1791 | Property { name: "tickCount"; type: "int" } | |
1742 | Property { name: "min"; type: "QDateTime" } |
|
1792 | Property { name: "min"; type: "QDateTime" } | |
1743 | Property { name: "max"; type: "QDateTime" } |
|
1793 | Property { name: "max"; type: "QDateTime" } | |
1744 | Property { name: "format"; type: "string" } |
|
1794 | Property { name: "format"; type: "string" } | |
1745 | Signal { |
|
1795 | Signal { | |
1746 | name: "minChanged" |
|
1796 | name: "minChanged" | |
1747 | Parameter { name: "min"; type: "QDateTime" } |
|
1797 | Parameter { name: "min"; type: "QDateTime" } | |
1748 | } |
|
1798 | } | |
1749 | Signal { |
|
1799 | Signal { | |
1750 | name: "maxChanged" |
|
1800 | name: "maxChanged" | |
1751 | Parameter { name: "max"; type: "QDateTime" } |
|
1801 | Parameter { name: "max"; type: "QDateTime" } | |
1752 | } |
|
1802 | } | |
1753 | Signal { |
|
1803 | Signal { | |
1754 | name: "rangeChanged" |
|
1804 | name: "rangeChanged" | |
1755 | Parameter { name: "min"; type: "QDateTime" } |
|
1805 | Parameter { name: "min"; type: "QDateTime" } | |
1756 | Parameter { name: "max"; type: "QDateTime" } |
|
1806 | Parameter { name: "max"; type: "QDateTime" } | |
1757 | } |
|
1807 | } | |
1758 | Signal { |
|
1808 | Signal { | |
1759 | name: "formatChanged" |
|
1809 | name: "formatChanged" | |
1760 | Parameter { name: "format"; type: "string" } |
|
1810 | Parameter { name: "format"; type: "string" } | |
1761 | } |
|
1811 | } | |
1762 | Signal { |
|
1812 | Signal { | |
1763 | name: "tickCountChanged" |
|
1813 | name: "tickCountChanged" | |
1764 | Parameter { name: "tick"; type: "int" } |
|
1814 | Parameter { name: "tick"; type: "int" } | |
1765 | } |
|
1815 | } | |
1766 | } |
|
1816 | } | |
1767 | Component { |
|
1817 | Component { | |
1768 | name: "QtCommercialChart::QHBarModelMapper" |
|
1818 | name: "QtCommercialChart::QHBarModelMapper" | |
1769 | prototype: "QtCommercialChart::QBarModelMapper" |
|
1819 | prototype: "QtCommercialChart::QBarModelMapper" | |
1770 | exports: ["QtCommercial.Chart/HBarModelMapper 1.0"] |
|
1820 | exports: ["QtCommercial.Chart/HBarModelMapper 1.0"] | |
1771 | exportMetaObjectRevisions: [0] |
|
1821 | exportMetaObjectRevisions: [0] | |
1772 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } |
|
1822 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } | |
1773 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
1823 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
1774 | Property { name: "firstBarSetRow"; type: "int" } |
|
1824 | Property { name: "firstBarSetRow"; type: "int" } | |
1775 | Property { name: "lastBarSetRow"; type: "int" } |
|
1825 | Property { name: "lastBarSetRow"; type: "int" } | |
1776 | Property { name: "firstColumn"; type: "int" } |
|
1826 | Property { name: "firstColumn"; type: "int" } | |
1777 | Property { name: "columnCount"; type: "int" } |
|
1827 | Property { name: "columnCount"; type: "int" } | |
1778 | Signal { name: "seriesReplaced" } |
|
1828 | Signal { name: "seriesReplaced" } | |
1779 | Signal { name: "modelReplaced" } |
|
1829 | Signal { name: "modelReplaced" } | |
1780 | } |
|
1830 | } | |
1781 | Component { |
|
1831 | Component { | |
1782 | name: "QtCommercialChart::QHPieModelMapper" |
|
1832 | name: "QtCommercialChart::QHPieModelMapper" | |
1783 | prototype: "QtCommercialChart::QPieModelMapper" |
|
1833 | prototype: "QtCommercialChart::QPieModelMapper" | |
1784 | exports: ["QtCommercial.Chart/HPieModelMapper 1.0"] |
|
1834 | exports: ["QtCommercial.Chart/HPieModelMapper 1.0"] | |
1785 | exportMetaObjectRevisions: [0] |
|
1835 | exportMetaObjectRevisions: [0] | |
1786 | Property { name: "series"; type: "QPieSeries"; isPointer: true } |
|
1836 | Property { name: "series"; type: "QPieSeries"; isPointer: true } | |
1787 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
1837 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
1788 | Property { name: "valuesRow"; type: "int" } |
|
1838 | Property { name: "valuesRow"; type: "int" } | |
1789 | Property { name: "labelsRow"; type: "int" } |
|
1839 | Property { name: "labelsRow"; type: "int" } | |
1790 | Property { name: "firstColumn"; type: "int" } |
|
1840 | Property { name: "firstColumn"; type: "int" } | |
1791 | Property { name: "columnCount"; type: "int" } |
|
1841 | Property { name: "columnCount"; type: "int" } | |
1792 | Signal { name: "seriesReplaced" } |
|
1842 | Signal { name: "seriesReplaced" } | |
1793 | Signal { name: "modelReplaced" } |
|
1843 | Signal { name: "modelReplaced" } | |
1794 | } |
|
1844 | } | |
1795 | Component { |
|
1845 | Component { | |
1796 | name: "QtCommercialChart::QHXYModelMapper" |
|
1846 | name: "QtCommercialChart::QHXYModelMapper" | |
1797 | prototype: "QtCommercialChart::QXYModelMapper" |
|
1847 | prototype: "QtCommercialChart::QXYModelMapper" | |
1798 | exports: ["QtCommercial.Chart/HXYModelMapper 1.0"] |
|
1848 | exports: ["QtCommercial.Chart/HXYModelMapper 1.0"] | |
1799 | exportMetaObjectRevisions: [0] |
|
1849 | exportMetaObjectRevisions: [0] | |
1800 | Property { name: "series"; type: "QXYSeries"; isPointer: true } |
|
1850 | Property { name: "series"; type: "QXYSeries"; isPointer: true } | |
1801 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
1851 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
1802 | Property { name: "xRow"; type: "int" } |
|
1852 | Property { name: "xRow"; type: "int" } | |
1803 | Property { name: "yRow"; type: "int" } |
|
1853 | Property { name: "yRow"; type: "int" } | |
1804 | Property { name: "firstColumn"; type: "int" } |
|
1854 | Property { name: "firstColumn"; type: "int" } | |
1805 | Property { name: "columnCount"; type: "int" } |
|
1855 | Property { name: "columnCount"; type: "int" } | |
1806 | Signal { name: "seriesReplaced" } |
|
1856 | Signal { name: "seriesReplaced" } | |
1807 | Signal { name: "modelReplaced" } |
|
1857 | Signal { name: "modelReplaced" } | |
1808 | } |
|
1858 | } | |
1809 | Component { |
|
1859 | Component { | |
1810 | name: "QtCommercialChart::QHorizontalBarSeries" |
|
1860 | name: "QtCommercialChart::QHorizontalBarSeries" | |
1811 | prototype: "QtCommercialChart::QAbstractBarSeries" |
|
1861 | prototype: "QtCommercialChart::QAbstractBarSeries" | |
1812 | } |
|
1862 | } | |
1813 | Component { |
|
1863 | Component { | |
1814 | name: "QtCommercialChart::QHorizontalPercentBarSeries" |
|
1864 | name: "QtCommercialChart::QHorizontalPercentBarSeries" | |
1815 | prototype: "QtCommercialChart::QAbstractBarSeries" |
|
1865 | prototype: "QtCommercialChart::QAbstractBarSeries" | |
1816 | } |
|
1866 | } | |
1817 | Component { |
|
1867 | Component { | |
1818 | name: "QtCommercialChart::QHorizontalStackedBarSeries" |
|
1868 | name: "QtCommercialChart::QHorizontalStackedBarSeries" | |
1819 | prototype: "QtCommercialChart::QAbstractBarSeries" |
|
1869 | prototype: "QtCommercialChart::QAbstractBarSeries" | |
1820 | } |
|
1870 | } | |
1821 | Component { |
|
1871 | Component { | |
1822 | name: "QtCommercialChart::QLegend" |
|
1872 | name: "QtCommercialChart::QLegend" | |
1823 | defaultProperty: "children" |
|
1873 | defaultProperty: "children" | |
1824 | prototype: "QGraphicsWidget" |
|
1874 | prototype: "QGraphicsWidget" | |
1825 | exports: ["QtCommercial.Chart/Legend 1.0"] |
|
1875 | exports: ["QtCommercial.Chart/Legend 1.0"] | |
1826 | isCreatable: false |
|
|||
1827 | exportMetaObjectRevisions: [0] |
|
1876 | exportMetaObjectRevisions: [0] | |
1828 | Property { name: "alignment"; type: "Qt::Alignment" } |
|
1877 | Property { name: "alignment"; type: "Qt::Alignment" } | |
1829 | Property { name: "backgroundVisible"; type: "bool" } |
|
1878 | Property { name: "backgroundVisible"; type: "bool" } | |
1830 | Property { name: "color"; type: "QColor" } |
|
1879 | Property { name: "color"; type: "QColor" } | |
1831 | Property { name: "borderColor"; type: "QColor" } |
|
1880 | Property { name: "borderColor"; type: "QColor" } | |
1832 | Property { name: "font"; type: "QFont" } |
|
1881 | Property { name: "font"; type: "QFont" } | |
1833 | Property { name: "labelColor"; type: "QColor" } |
|
1882 | Property { name: "labelColor"; type: "QColor" } | |
1834 | Property { name: "reverseMarkers"; type: "bool" } |
|
1883 | Property { name: "reverseMarkers"; type: "bool" } | |
1835 | Signal { |
|
1884 | Signal { | |
1836 | name: "backgroundVisibleChanged" |
|
1885 | name: "backgroundVisibleChanged" | |
1837 | Parameter { name: "visible"; type: "bool" } |
|
1886 | Parameter { name: "visible"; type: "bool" } | |
1838 | } |
|
1887 | } | |
1839 | Signal { |
|
1888 | Signal { | |
1840 | name: "colorChanged" |
|
1889 | name: "colorChanged" | |
1841 | Parameter { name: "color"; type: "QColor" } |
|
1890 | Parameter { name: "color"; type: "QColor" } | |
1842 | } |
|
1891 | } | |
1843 | Signal { |
|
1892 | Signal { | |
1844 | name: "borderColorChanged" |
|
1893 | name: "borderColorChanged" | |
1845 | Parameter { name: "color"; type: "QColor" } |
|
1894 | Parameter { name: "color"; type: "QColor" } | |
1846 | } |
|
1895 | } | |
1847 | Signal { |
|
1896 | Signal { | |
1848 | name: "fontChanged" |
|
1897 | name: "fontChanged" | |
1849 | Parameter { name: "font"; type: "QFont" } |
|
1898 | Parameter { name: "font"; type: "QFont" } | |
1850 | } |
|
1899 | } | |
1851 | Signal { |
|
1900 | Signal { | |
1852 | name: "labelColorChanged" |
|
1901 | name: "labelColorChanged" | |
1853 | Parameter { name: "color"; type: "QColor" } |
|
1902 | Parameter { name: "color"; type: "QColor" } | |
1854 | } |
|
1903 | } | |
1855 | Signal { |
|
1904 | Signal { | |
1856 | name: "reverseMarkersChanged" |
|
1905 | name: "reverseMarkersChanged" | |
1857 | Parameter { name: "reverseMarkers"; type: "bool" } |
|
1906 | Parameter { name: "reverseMarkers"; type: "bool" } | |
1858 | } |
|
1907 | } | |
1859 | } |
|
1908 | } | |
1860 | Component { name: "QtCommercialChart::QLineSeries"; prototype: "QtCommercialChart::QXYSeries" } |
|
1909 | Component { name: "QtCommercialChart::QLineSeries"; prototype: "QtCommercialChart::QXYSeries" } | |
1861 | Component { |
|
1910 | Component { | |
1862 | name: "QtCommercialChart::QLogValueAxis" |
|
1911 | name: "QtCommercialChart::QLogValueAxis" | |
1863 | prototype: "QtCommercialChart::QAbstractAxis" |
|
1912 | prototype: "QtCommercialChart::QAbstractAxis" | |
1864 | exports: ["QtCommercial.Chart/LogValueAxis 1.3"] |
|
1913 | exports: ["QtCommercial.Chart/LogValueAxis 1.3"] | |
1865 | exportMetaObjectRevisions: [0] |
|
1914 | exportMetaObjectRevisions: [0] | |
1866 | Property { name: "min"; type: "double" } |
|
1915 | Property { name: "min"; type: "double" } | |
1867 | Property { name: "max"; type: "double" } |
|
1916 | Property { name: "max"; type: "double" } | |
1868 | Property { name: "labelFormat"; type: "string" } |
|
1917 | Property { name: "labelFormat"; type: "string" } | |
1869 | Property { name: "base"; type: "double" } |
|
1918 | Property { name: "base"; type: "double" } | |
1870 | Signal { |
|
1919 | Signal { | |
1871 | name: "minChanged" |
|
1920 | name: "minChanged" | |
1872 | Parameter { name: "min"; type: "double" } |
|
1921 | Parameter { name: "min"; type: "double" } | |
1873 | } |
|
1922 | } | |
1874 | Signal { |
|
1923 | Signal { | |
1875 | name: "maxChanged" |
|
1924 | name: "maxChanged" | |
1876 | Parameter { name: "max"; type: "double" } |
|
1925 | Parameter { name: "max"; type: "double" } | |
1877 | } |
|
1926 | } | |
1878 | Signal { |
|
1927 | Signal { | |
1879 | name: "rangeChanged" |
|
1928 | name: "rangeChanged" | |
1880 | Parameter { name: "min"; type: "double" } |
|
1929 | Parameter { name: "min"; type: "double" } | |
1881 | Parameter { name: "max"; type: "double" } |
|
1930 | Parameter { name: "max"; type: "double" } | |
1882 | } |
|
1931 | } | |
1883 | Signal { |
|
1932 | Signal { | |
1884 | name: "labelFormatChanged" |
|
1933 | name: "labelFormatChanged" | |
1885 | Parameter { name: "format"; type: "string" } |
|
1934 | Parameter { name: "format"; type: "string" } | |
1886 | } |
|
1935 | } | |
1887 | Signal { |
|
1936 | Signal { | |
1888 | name: "baseChanged" |
|
1937 | name: "baseChanged" | |
1889 | Parameter { name: "base"; type: "double" } |
|
1938 | Parameter { name: "base"; type: "double" } | |
1890 | } |
|
1939 | } | |
1891 | } |
|
1940 | } | |
1892 | Component { |
|
1941 | Component { | |
1893 | name: "QtCommercialChart::QPercentBarSeries" |
|
1942 | name: "QtCommercialChart::QPercentBarSeries" | |
1894 | prototype: "QtCommercialChart::QAbstractBarSeries" |
|
1943 | prototype: "QtCommercialChart::QAbstractBarSeries" | |
1895 | } |
|
1944 | } | |
1896 | Component { |
|
1945 | Component { | |
1897 | name: "QtCommercialChart::QPieModelMapper" |
|
1946 | name: "QtCommercialChart::QPieModelMapper" | |
1898 | prototype: "QObject" |
|
1947 | prototype: "QObject" | |
1899 | exports: ["QtCommercial.Chart/PieModelMapper 1.0"] |
|
1948 | exports: ["QtCommercial.Chart/PieModelMapper 1.0"] | |
1900 | isCreatable: false |
|
|||
1901 | exportMetaObjectRevisions: [0] |
|
1949 | exportMetaObjectRevisions: [0] | |
1902 | } |
|
1950 | } | |
1903 | Component { |
|
1951 | Component { | |
1904 | name: "QtCommercialChart::QPieSeries" |
|
1952 | name: "QtCommercialChart::QPieSeries" | |
1905 | prototype: "QtCommercialChart::QAbstractSeries" |
|
1953 | prototype: "QtCommercialChart::QAbstractSeries" | |
1906 | exports: ["QtCommercial.Chart/QPieSeries 1.0"] |
|
1954 | exports: ["QtCommercial.Chart/QPieSeries 1.0"] | |
1907 | isCreatable: false |
|
|||
1908 | exportMetaObjectRevisions: [0] |
|
1955 | exportMetaObjectRevisions: [0] | |
1909 | Property { name: "horizontalPosition"; type: "double" } |
|
1956 | Property { name: "horizontalPosition"; type: "double" } | |
1910 | Property { name: "verticalPosition"; type: "double" } |
|
1957 | Property { name: "verticalPosition"; type: "double" } | |
1911 | Property { name: "size"; type: "double" } |
|
1958 | Property { name: "size"; type: "double" } | |
1912 | Property { name: "startAngle"; type: "double" } |
|
1959 | Property { name: "startAngle"; type: "double" } | |
1913 | Property { name: "endAngle"; type: "double" } |
|
1960 | Property { name: "endAngle"; type: "double" } | |
1914 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1961 | Property { name: "count"; type: "int"; isReadonly: true } | |
1915 | Property { name: "sum"; type: "double"; isReadonly: true } |
|
1962 | Property { name: "sum"; type: "double"; isReadonly: true } | |
1916 | Property { name: "holeSize"; type: "double" } |
|
1963 | Property { name: "holeSize"; type: "double" } | |
1917 | Signal { |
|
1964 | Signal { | |
1918 | name: "added" |
|
1965 | name: "added" | |
1919 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
1966 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
1920 | } |
|
1967 | } | |
1921 | Signal { |
|
1968 | Signal { | |
1922 | name: "removed" |
|
1969 | name: "removed" | |
1923 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
1970 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
1924 | } |
|
1971 | } | |
1925 | Signal { |
|
1972 | Signal { | |
1926 | name: "clicked" |
|
1973 | name: "clicked" | |
1927 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1974 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1928 | } |
|
1975 | } | |
1929 | Signal { |
|
1976 | Signal { | |
1930 | name: "hovered" |
|
1977 | name: "hovered" | |
1931 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1978 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1932 | Parameter { name: "state"; type: "bool" } |
|
1979 | Parameter { name: "state"; type: "bool" } | |
1933 | } |
|
1980 | } | |
1934 | } |
|
1981 | } | |
1935 | Component { |
|
1982 | Component { | |
1936 | name: "QtCommercialChart::QPieSlice" |
|
1983 | name: "QtCommercialChart::QPieSlice" | |
1937 | prototype: "QObject" |
|
1984 | prototype: "QObject" | |
1938 | exports: ["QtCommercial.Chart/PieSlice 1.0"] |
|
1985 | exports: ["QtCommercial.Chart/PieSlice 1.0"] | |
1939 | exportMetaObjectRevisions: [0] |
|
1986 | exportMetaObjectRevisions: [0] | |
1940 | Enum { |
|
1987 | Enum { | |
1941 | name: "LabelPosition" |
|
1988 | name: "LabelPosition" | |
1942 | values: { |
|
1989 | values: { | |
1943 | "LabelOutside": 0, |
|
1990 | "LabelOutside": 0, | |
1944 | "LabelInsideHorizontal": 1, |
|
1991 | "LabelInsideHorizontal": 1, | |
1945 | "LabelInsideTangential": 2, |
|
1992 | "LabelInsideTangential": 2, | |
1946 | "LabelInsideNormal": 3 |
|
1993 | "LabelInsideNormal": 3 | |
1947 | } |
|
1994 | } | |
1948 | } |
|
1995 | } | |
1949 | Property { name: "label"; type: "string" } |
|
1996 | Property { name: "label"; type: "string" } | |
1950 | Property { name: "value"; type: "double" } |
|
1997 | Property { name: "value"; type: "double" } | |
1951 | Property { name: "labelVisible"; type: "bool" } |
|
1998 | Property { name: "labelVisible"; type: "bool" } | |
1952 | Property { name: "labelPosition"; type: "LabelPosition" } |
|
1999 | Property { name: "labelPosition"; type: "LabelPosition" } | |
1953 | Property { name: "exploded"; type: "bool" } |
|
2000 | Property { name: "exploded"; type: "bool" } | |
1954 | Property { name: "pen"; type: "QPen" } |
|
2001 | Property { name: "pen"; type: "QPen" } | |
1955 | Property { name: "borderColor"; type: "QColor" } |
|
2002 | Property { name: "borderColor"; type: "QColor" } | |
1956 | Property { name: "borderWidth"; type: "int" } |
|
2003 | Property { name: "borderWidth"; type: "int" } | |
1957 | Property { name: "brush"; type: "QBrush" } |
|
2004 | Property { name: "brush"; type: "QBrush" } | |
1958 | Property { name: "color"; type: "QColor" } |
|
2005 | Property { name: "color"; type: "QColor" } | |
1959 | Property { name: "labelBrush"; type: "QBrush" } |
|
2006 | Property { name: "labelBrush"; type: "QBrush" } | |
1960 | Property { name: "labelColor"; type: "QColor" } |
|
2007 | Property { name: "labelColor"; type: "QColor" } | |
1961 | Property { name: "labelFont"; type: "QFont" } |
|
2008 | Property { name: "labelFont"; type: "QFont" } | |
1962 | Property { name: "labelArmLengthFactor"; type: "double" } |
|
2009 | Property { name: "labelArmLengthFactor"; type: "double" } | |
1963 | Property { name: "explodeDistanceFactor"; type: "double" } |
|
2010 | Property { name: "explodeDistanceFactor"; type: "double" } | |
1964 | Property { name: "percentage"; type: "double"; isReadonly: true } |
|
2011 | Property { name: "percentage"; type: "double"; isReadonly: true } | |
1965 | Property { name: "startAngle"; type: "double"; isReadonly: true } |
|
2012 | Property { name: "startAngle"; type: "double"; isReadonly: true } | |
1966 | Property { name: "angleSpan"; type: "double"; isReadonly: true } |
|
2013 | Property { name: "angleSpan"; type: "double"; isReadonly: true } | |
1967 | Signal { name: "clicked" } |
|
2014 | Signal { name: "clicked" } | |
1968 | Signal { |
|
2015 | Signal { | |
1969 | name: "hovered" |
|
2016 | name: "hovered" | |
1970 | Parameter { name: "state"; type: "bool" } |
|
2017 | Parameter { name: "state"; type: "bool" } | |
1971 | } |
|
2018 | } | |
1972 | } |
|
2019 | } | |
1973 | Component { |
|
2020 | Component { | |
1974 | name: "QtCommercialChart::QScatterSeries" |
|
2021 | name: "QtCommercialChart::QScatterSeries" | |
1975 | prototype: "QtCommercialChart::QXYSeries" |
|
2022 | prototype: "QtCommercialChart::QXYSeries" | |
1976 | Enum { |
|
2023 | Enum { | |
1977 | name: "MarkerShape" |
|
2024 | name: "MarkerShape" | |
1978 | values: { |
|
2025 | values: { | |
1979 | "MarkerShapeCircle": 0, |
|
2026 | "MarkerShapeCircle": 0, | |
1980 | "MarkerShapeRectangle": 1 |
|
2027 | "MarkerShapeRectangle": 1 | |
1981 | } |
|
2028 | } | |
1982 | } |
|
2029 | } | |
1983 | Property { name: "color"; type: "QColor" } |
|
2030 | Property { name: "color"; type: "QColor" } | |
1984 | Property { name: "borderColor"; type: "QColor" } |
|
2031 | Property { name: "borderColor"; type: "QColor" } | |
1985 | Property { name: "markerShape"; type: "MarkerShape" } |
|
2032 | Property { name: "markerShape"; type: "MarkerShape" } | |
1986 | Property { name: "markerSize"; type: "double" } |
|
2033 | Property { name: "markerSize"; type: "double" } | |
|
2034 | Property { name: "brush"; type: "QBrush" } | |||
1987 | Signal { |
|
2035 | Signal { | |
1988 | name: "colorChanged" |
|
2036 | name: "colorChanged" | |
1989 | Parameter { name: "color"; type: "QColor" } |
|
2037 | Parameter { name: "color"; type: "QColor" } | |
1990 | } |
|
2038 | } | |
1991 | Signal { |
|
2039 | Signal { | |
1992 | name: "borderColorChanged" |
|
2040 | name: "borderColorChanged" | |
1993 | Parameter { name: "color"; type: "QColor" } |
|
2041 | Parameter { name: "color"; type: "QColor" } | |
1994 | } |
|
2042 | } | |
1995 | } |
|
2043 | } | |
1996 | Component { |
|
2044 | Component { | |
1997 | name: "QtCommercialChart::QSplineSeries" |
|
2045 | name: "QtCommercialChart::QSplineSeries" | |
1998 | prototype: "QtCommercialChart::QLineSeries" |
|
2046 | prototype: "QtCommercialChart::QLineSeries" | |
1999 | } |
|
2047 | } | |
2000 | Component { |
|
2048 | Component { | |
2001 | name: "QtCommercialChart::QStackedBarSeries" |
|
2049 | name: "QtCommercialChart::QStackedBarSeries" | |
2002 | prototype: "QtCommercialChart::QAbstractBarSeries" |
|
2050 | prototype: "QtCommercialChart::QAbstractBarSeries" | |
2003 | } |
|
2051 | } | |
2004 | Component { |
|
2052 | Component { | |
2005 | name: "QtCommercialChart::QVBarModelMapper" |
|
2053 | name: "QtCommercialChart::QVBarModelMapper" | |
2006 | prototype: "QtCommercialChart::QBarModelMapper" |
|
2054 | prototype: "QtCommercialChart::QBarModelMapper" | |
2007 | exports: ["QtCommercial.Chart/VBarModelMapper 1.0"] |
|
2055 | exports: ["QtCommercial.Chart/VBarModelMapper 1.0"] | |
2008 | exportMetaObjectRevisions: [0] |
|
2056 | exportMetaObjectRevisions: [0] | |
2009 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } |
|
2057 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } | |
2010 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2058 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2011 | Property { name: "firstBarSetColumn"; type: "int" } |
|
2059 | Property { name: "firstBarSetColumn"; type: "int" } | |
2012 | Property { name: "lastBarSetColumn"; type: "int" } |
|
2060 | Property { name: "lastBarSetColumn"; type: "int" } | |
2013 | Property { name: "firstRow"; type: "int" } |
|
2061 | Property { name: "firstRow"; type: "int" } | |
2014 | Property { name: "rowCount"; type: "int" } |
|
2062 | Property { name: "rowCount"; type: "int" } | |
2015 | Signal { name: "seriesReplaced" } |
|
2063 | Signal { name: "seriesReplaced" } | |
2016 | Signal { name: "modelReplaced" } |
|
2064 | Signal { name: "modelReplaced" } | |
2017 | } |
|
2065 | } | |
2018 | Component { |
|
2066 | Component { | |
2019 | name: "QtCommercialChart::QVPieModelMapper" |
|
2067 | name: "QtCommercialChart::QVPieModelMapper" | |
2020 | prototype: "QtCommercialChart::QPieModelMapper" |
|
2068 | prototype: "QtCommercialChart::QPieModelMapper" | |
2021 | exports: ["QtCommercial.Chart/VPieModelMapper 1.0"] |
|
2069 | exports: ["QtCommercial.Chart/VPieModelMapper 1.0"] | |
2022 | exportMetaObjectRevisions: [0] |
|
2070 | exportMetaObjectRevisions: [0] | |
2023 | Property { name: "series"; type: "QPieSeries"; isPointer: true } |
|
2071 | Property { name: "series"; type: "QPieSeries"; isPointer: true } | |
2024 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2072 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2025 | Property { name: "valuesColumn"; type: "int" } |
|
2073 | Property { name: "valuesColumn"; type: "int" } | |
2026 | Property { name: "labelsColumn"; type: "int" } |
|
2074 | Property { name: "labelsColumn"; type: "int" } | |
2027 | Property { name: "firstRow"; type: "int" } |
|
2075 | Property { name: "firstRow"; type: "int" } | |
2028 | Property { name: "rowCount"; type: "int" } |
|
2076 | Property { name: "rowCount"; type: "int" } | |
2029 | Signal { name: "seriesReplaced" } |
|
2077 | Signal { name: "seriesReplaced" } | |
2030 | Signal { name: "modelReplaced" } |
|
2078 | Signal { name: "modelReplaced" } | |
2031 | } |
|
2079 | } | |
2032 | Component { |
|
2080 | Component { | |
2033 | name: "QtCommercialChart::QVXYModelMapper" |
|
2081 | name: "QtCommercialChart::QVXYModelMapper" | |
2034 | prototype: "QtCommercialChart::QXYModelMapper" |
|
2082 | prototype: "QtCommercialChart::QXYModelMapper" | |
2035 | exports: ["QtCommercial.Chart/VXYModelMapper 1.0"] |
|
2083 | exports: ["QtCommercial.Chart/VXYModelMapper 1.0"] | |
2036 | exportMetaObjectRevisions: [0] |
|
2084 | exportMetaObjectRevisions: [0] | |
2037 | Property { name: "series"; type: "QXYSeries"; isPointer: true } |
|
2085 | Property { name: "series"; type: "QXYSeries"; isPointer: true } | |
2038 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2086 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2039 | Property { name: "xColumn"; type: "int" } |
|
2087 | Property { name: "xColumn"; type: "int" } | |
2040 | Property { name: "yColumn"; type: "int" } |
|
2088 | Property { name: "yColumn"; type: "int" } | |
2041 | Property { name: "firstRow"; type: "int" } |
|
2089 | Property { name: "firstRow"; type: "int" } | |
2042 | Property { name: "rowCount"; type: "int" } |
|
2090 | Property { name: "rowCount"; type: "int" } | |
2043 | Signal { name: "seriesReplaced" } |
|
2091 | Signal { name: "seriesReplaced" } | |
2044 | Signal { name: "modelReplaced" } |
|
2092 | Signal { name: "modelReplaced" } | |
2045 | } |
|
2093 | } | |
2046 | Component { |
|
2094 | Component { | |
2047 | name: "QtCommercialChart::QValueAxis" |
|
2095 | name: "QtCommercialChart::QValueAxis" | |
2048 | prototype: "QtCommercialChart::QAbstractAxis" |
|
2096 | prototype: "QtCommercialChart::QAbstractAxis" | |
2049 | exports: [ |
|
2097 | exports: [ | |
2050 | "QtCommercial.Chart/ValueAxis 1.1", |
|
2098 | "QtCommercial.Chart/ValueAxis 1.1", | |
2051 | "QtCommercial.Chart/ValuesAxis 1.0" |
|
2099 | "QtCommercial.Chart/ValuesAxis 1.0" | |
2052 | ] |
|
2100 | ] | |
2053 | exportMetaObjectRevisions: [0, 0] |
|
2101 | exportMetaObjectRevisions: [0, 0] | |
2054 | Property { name: "tickCount"; type: "int" } |
|
2102 | Property { name: "tickCount"; type: "int" } | |
2055 | Property { name: "niceNumbersEnabled"; type: "bool" } |
|
2103 | Property { name: "niceNumbersEnabled"; type: "bool" } | |
2056 | Property { name: "min"; type: "double" } |
|
2104 | Property { name: "min"; type: "double" } | |
2057 | Property { name: "max"; type: "double" } |
|
2105 | Property { name: "max"; type: "double" } | |
2058 | Property { name: "labelFormat"; type: "string" } |
|
2106 | Property { name: "labelFormat"; type: "string" } | |
2059 | Signal { |
|
2107 | Signal { | |
2060 | name: "minChanged" |
|
2108 | name: "minChanged" | |
2061 | Parameter { name: "min"; type: "double" } |
|
2109 | Parameter { name: "min"; type: "double" } | |
2062 | } |
|
2110 | } | |
2063 | Signal { |
|
2111 | Signal { | |
2064 | name: "maxChanged" |
|
2112 | name: "maxChanged" | |
2065 | Parameter { name: "max"; type: "double" } |
|
2113 | Parameter { name: "max"; type: "double" } | |
2066 | } |
|
2114 | } | |
2067 | Signal { |
|
2115 | Signal { | |
2068 | name: "rangeChanged" |
|
2116 | name: "rangeChanged" | |
2069 | Parameter { name: "min"; type: "double" } |
|
2117 | Parameter { name: "min"; type: "double" } | |
2070 | Parameter { name: "max"; type: "double" } |
|
2118 | Parameter { name: "max"; type: "double" } | |
2071 | } |
|
2119 | } | |
2072 | Signal { |
|
2120 | Signal { | |
2073 | name: "tickCountChanged" |
|
2121 | name: "tickCountChanged" | |
2074 | Parameter { name: "tickCount"; type: "int" } |
|
2122 | Parameter { name: "tickCount"; type: "int" } | |
2075 | } |
|
2123 | } | |
2076 | Signal { |
|
2124 | Signal { | |
2077 | name: "labelFormatChanged" |
|
2125 | name: "labelFormatChanged" | |
2078 | Parameter { name: "format"; type: "string" } |
|
2126 | Parameter { name: "format"; type: "string" } | |
2079 | } |
|
2127 | } | |
2080 | Method { name: "applyNiceNumbers" } |
|
2128 | Method { name: "applyNiceNumbers" } | |
2081 | } |
|
2129 | } | |
2082 | Component { |
|
2130 | Component { | |
2083 | name: "QtCommercialChart::QXYModelMapper" |
|
2131 | name: "QtCommercialChart::QXYModelMapper" | |
2084 | prototype: "QObject" |
|
2132 | prototype: "QObject" | |
2085 | exports: ["QtCommercial.Chart/XYModelMapper 1.0"] |
|
2133 | exports: ["QtCommercial.Chart/XYModelMapper 1.0"] | |
2086 | isCreatable: false |
|
|||
2087 | exportMetaObjectRevisions: [0] |
|
2134 | exportMetaObjectRevisions: [0] | |
2088 | } |
|
2135 | } | |
2089 | Component { |
|
2136 | Component { | |
2090 | name: "QtCommercialChart::QXYSeries" |
|
2137 | name: "QtCommercialChart::QXYSeries" | |
2091 | prototype: "QtCommercialChart::QAbstractSeries" |
|
2138 | prototype: "QtCommercialChart::QAbstractSeries" | |
2092 | exports: ["QtCommercial.Chart/XYSeries 1.0"] |
|
2139 | exports: ["QtCommercial.Chart/XYSeries 1.0"] | |
2093 | isCreatable: false |
|
|||
2094 | exportMetaObjectRevisions: [0] |
|
2140 | exportMetaObjectRevisions: [0] | |
2095 | Property { name: "pointsVisible"; type: "bool" } |
|
2141 | Property { name: "pointsVisible"; type: "bool" } | |
2096 | Property { name: "color"; type: "QColor" } |
|
2142 | Property { name: "color"; type: "QColor" } | |
2097 | Signal { |
|
2143 | Signal { | |
2098 | name: "clicked" |
|
2144 | name: "clicked" | |
2099 | Parameter { name: "point"; type: "QPointF" } |
|
2145 | Parameter { name: "point"; type: "QPointF" } | |
2100 | } |
|
2146 | } | |
2101 | Signal { |
|
2147 | Signal { | |
2102 | name: "hovered" |
|
2148 | name: "hovered" | |
2103 | Parameter { name: "point"; type: "QPointF" } |
|
2149 | Parameter { name: "point"; type: "QPointF" } | |
2104 | Parameter { name: "state"; type: "bool" } |
|
2150 | Parameter { name: "state"; type: "bool" } | |
2105 | } |
|
2151 | } | |
2106 | Signal { |
|
2152 | Signal { | |
2107 | name: "pointReplaced" |
|
2153 | name: "pointReplaced" | |
2108 | Parameter { name: "index"; type: "int" } |
|
2154 | Parameter { name: "index"; type: "int" } | |
2109 | } |
|
2155 | } | |
2110 | Signal { |
|
2156 | Signal { | |
2111 | name: "pointRemoved" |
|
2157 | name: "pointRemoved" | |
2112 | Parameter { name: "index"; type: "int" } |
|
2158 | Parameter { name: "index"; type: "int" } | |
2113 | } |
|
2159 | } | |
2114 | Signal { |
|
2160 | Signal { | |
2115 | name: "pointAdded" |
|
2161 | name: "pointAdded" | |
2116 | Parameter { name: "index"; type: "int" } |
|
2162 | Parameter { name: "index"; type: "int" } | |
2117 | } |
|
2163 | } | |
2118 | Signal { |
|
2164 | Signal { | |
2119 | name: "colorChanged" |
|
2165 | name: "colorChanged" | |
2120 | Parameter { name: "color"; type: "QColor" } |
|
2166 | Parameter { name: "color"; type: "QColor" } | |
2121 | } |
|
2167 | } | |
2122 | Signal { name: "pointsReplaced" } |
|
2168 | Signal { name: "pointsReplaced" } | |
2123 | } |
|
2169 | } | |
2124 | } |
|
2170 | } |
@@ -1,474 +1,479 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qareaseries.h" |
|
21 | #include "qareaseries.h" | |
22 | #include "qareaseries_p.h" |
|
22 | #include "qareaseries_p.h" | |
23 | #include "qlineseries.h" |
|
23 | #include "qlineseries.h" | |
24 | #include "areachartitem_p.h" |
|
24 | #include "areachartitem_p.h" | |
25 | #include "abstractdomain_p.h" |
|
25 | #include "abstractdomain_p.h" | |
26 | #include "chartdataset_p.h" |
|
26 | #include "chartdataset_p.h" | |
27 | #include "charttheme_p.h" |
|
27 | #include "charttheme_p.h" | |
28 | #include "qvalueaxis.h" |
|
28 | #include "qvalueaxis.h" | |
29 | #include "qarealegendmarker.h" |
|
29 | #include "qarealegendmarker.h" | |
30 | #include "qchart_p.h" |
|
30 | #include "qchart_p.h" | |
31 |
|
31 | |||
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
33 |
|
33 | |||
34 | /*! |
|
34 | /*! | |
35 | \class QAreaSeries |
|
35 | \class QAreaSeries | |
36 | \inmodule Qt Charts |
|
36 | \inmodule Qt Charts | |
37 | \brief The QAreaSeries class is used for making area charts. |
|
37 | \brief The QAreaSeries class is used for making area charts. | |
38 |
|
38 | |||
39 | \mainclass |
|
39 | \mainclass | |
40 |
|
40 | |||
41 | An area chart is used to show quantitative data. It is based on line chart, in the way that area between axis and the line |
|
41 | An area chart is used to show quantitative data. It is based on line chart, in the way that area between axis and the line | |
42 | is emphasized with color. Since the area chart is based on line chart, QAreaSeries constructor needs QLineSeries instance, |
|
42 | is emphasized with color. Since the area chart is based on line chart, QAreaSeries constructor needs QLineSeries instance, | |
43 | which defines "upper" boundary of the area. "Lower" boundary is defined by default by axis X. Instead of axis X "lower" boundary can be specified by other line. |
|
43 | which defines "upper" boundary of the area. "Lower" boundary is defined by default by axis X. Instead of axis X "lower" boundary can be specified by other line. | |
44 | In that case QAreaSeries should be initiated with two QLineSeries instances. Please note terms "upper" and "lower" boundary can be misleading in cases |
|
44 | In that case QAreaSeries should be initiated with two QLineSeries instances. Please note terms "upper" and "lower" boundary can be misleading in cases | |
45 | where "lower" boundary had bigger values than the "upper" one, however the main point that area between these two boundary lines will be filled. |
|
45 | where "lower" boundary had bigger values than the "upper" one, however the main point that area between these two boundary lines will be filled. | |
46 |
|
46 | |||
47 | See the \l {AreaChart Example} {area chart example} to learn how to create a simple area chart. |
|
47 | See the \l {AreaChart Example} {area chart example} to learn how to create a simple area chart. | |
48 | \image examples_areachart.png |
|
48 | \image examples_areachart.png | |
49 | */ |
|
49 | */ | |
50 | #ifdef QDOC_QT5 |
|
50 | #ifdef QDOC_QT5 | |
51 | /*! |
|
51 | /*! | |
52 | \qmltype AreaSeries |
|
52 | \qmltype AreaSeries | |
53 | \instantiates QAreaSeries |
|
53 | \instantiates QAreaSeries | |
54 | \inqmlmodule QtCommercial.Chart |
|
54 | \inqmlmodule QtCommercial.Chart | |
55 |
|
55 | |||
56 | \include doc/src/areaseries.qdocinc |
|
56 | \include doc/src/areaseries.qdocinc | |
57 | */ |
|
57 | */ | |
58 | #else |
|
58 | #else | |
59 | /*! |
|
59 | /*! | |
60 | \qmlclass AreaSeries QAreaSeries |
|
60 | \qmlclass AreaSeries QAreaSeries | |
61 |
|
61 | |||
62 | \include ../doc/src/areaseries.qdocinc |
|
62 | \include ../doc/src/areaseries.qdocinc | |
63 | */ |
|
63 | */ | |
64 | #endif |
|
64 | #endif | |
65 |
|
65 | |||
66 | /*! |
|
66 | /*! | |
67 | \property QAreaSeries::upperSeries |
|
67 | \property QAreaSeries::upperSeries | |
68 | \brief The upper one of the two line series used to define area series boundaries. |
|
68 | \brief The upper one of the two line series used to define area series boundaries. | |
69 | */ |
|
69 | */ | |
70 | /*! |
|
70 | /*! | |
71 | \qmlproperty LineSeries AreaSeries::upperSeries |
|
71 | \qmlproperty LineSeries AreaSeries::upperSeries | |
72 | The upper one of the two line series used to define area series boundaries. |
|
72 | The upper one of the two line series used to define area series boundaries. | |
73 | */ |
|
73 | */ | |
74 |
|
74 | |||
75 | /*! |
|
75 | /*! | |
76 | \property QAreaSeries::lowerSeries |
|
76 | \property QAreaSeries::lowerSeries | |
77 | The lower one of the two line series used to define are series boundaries. Note if |
|
77 | The lower one of the two line series used to define are series boundaries. Note if | |
78 | QAreaSeries was constructed without a\ lowerSeries this is null. |
|
78 | QAreaSeries was constructed without a\ lowerSeries this is null. | |
79 | */ |
|
79 | */ | |
80 | /*! |
|
80 | /*! | |
81 | \qmlproperty LineSeries AreaSeries::lowerSeries |
|
81 | \qmlproperty LineSeries AreaSeries::lowerSeries | |
82 | The lower one of the two line series used to define are series boundaries. Note if |
|
82 | The lower one of the two line series used to define are series boundaries. Note if | |
83 | AreaSeries was constructed without a\ lowerSeries this is null. |
|
83 | AreaSeries was constructed without a\ lowerSeries this is null. | |
84 | */ |
|
84 | */ | |
85 |
|
85 | |||
86 | /*! |
|
86 | /*! | |
87 | \property QAreaSeries::color |
|
87 | \property QAreaSeries::color | |
88 | Fill (brush) color of the series. This is a convenience property for modifying the color of brush. |
|
88 | Fill (brush) color of the series. This is a convenience property for modifying the color of brush. | |
89 | \sa QAreaSeries::brush() |
|
89 | \sa QAreaSeries::brush() | |
90 | */ |
|
90 | */ | |
91 | /*! |
|
91 | /*! | |
92 | \qmlproperty color AreaSeries::color |
|
92 | \qmlproperty color AreaSeries::color | |
93 | Fill (brush) color of the series. |
|
93 | Fill (brush) color of the series. | |
94 | */ |
|
94 | */ | |
95 |
|
95 | |||
96 | /*! |
|
96 | /*! | |
97 | \property QAreaSeries::borderColor |
|
97 | \property QAreaSeries::borderColor | |
98 | Line (pen) color of the series. This is a convenience property for modifying the color of pen. |
|
98 | Line (pen) color of the series. This is a convenience property for modifying the color of pen. | |
99 | \sa QAreaSeries::pen() |
|
99 | \sa QAreaSeries::pen() | |
100 | */ |
|
100 | */ | |
101 | /*! |
|
101 | /*! | |
102 | \qmlproperty color AreaSeries::borderColor |
|
102 | \qmlproperty color AreaSeries::borderColor | |
103 | Line (pen) color of the series. |
|
103 | Line (pen) color of the series. | |
104 | */ |
|
104 | */ | |
105 |
|
105 | |||
106 | /*! |
|
106 | /*! | |
107 | \qmlproperty real AreaSeries::borderWidth |
|
107 | \qmlproperty real AreaSeries::borderWidth | |
108 | The width of the border line. By default the width is 2.0. |
|
108 | The width of the border line. By default the width is 2.0. | |
109 | */ |
|
109 | */ | |
110 |
|
110 | |||
111 | /*! |
|
111 | /*! | |
112 | \fn QPen QAreaSeries::pen() const |
|
112 | \fn QPen QAreaSeries::pen() const | |
113 | \brief Returns the pen used to draw line for this series. |
|
113 | \brief Returns the pen used to draw line for this series. | |
114 | \sa setPen() |
|
114 | \sa setPen() | |
115 | */ |
|
115 | */ | |
116 |
|
116 | |||
117 | /*! |
|
117 | /*! | |
118 | \fn QPen QAreaSeries::brush() const |
|
118 | \fn QPen QAreaSeries::brush() const | |
119 | \brief Returns the brush used to draw line for this series. |
|
119 | \brief Returns the brush used to draw line for this series. | |
120 | \sa setBrush() |
|
120 | \sa setBrush() | |
121 | */ |
|
121 | */ | |
122 |
|
122 | |||
123 | /*! |
|
123 | /*! | |
|
124 | \qmlproperty QString AreaSeries::brushFilename | |||
|
125 | The name of the file used as a brush image for the series. | |||
|
126 | */ | |||
|
127 | ||||
|
128 | /*! | |||
124 | \fn void QAreaSeries::colorChanged(QColor color) |
|
129 | \fn void QAreaSeries::colorChanged(QColor color) | |
125 | \brief Signal is emitted when the fill (brush) color has changed to \a color. |
|
130 | \brief Signal is emitted when the fill (brush) color has changed to \a color. | |
126 | */ |
|
131 | */ | |
127 | /*! |
|
132 | /*! | |
128 | \qmlsignal AreaSeries::onColorChanged(color color) |
|
133 | \qmlsignal AreaSeries::onColorChanged(color color) | |
129 | Signal is emitted when the fill (brush) color has changed to \a color. |
|
134 | Signal is emitted when the fill (brush) color has changed to \a color. | |
130 | */ |
|
135 | */ | |
131 |
|
136 | |||
132 | /*! |
|
137 | /*! | |
133 | \fn void QAreaSeries::borderColorChanged(QColor color) |
|
138 | \fn void QAreaSeries::borderColorChanged(QColor color) | |
134 | \brief Signal is emitted when the line (pen) color has changed to \a color. |
|
139 | \brief Signal is emitted when the line (pen) color has changed to \a color. | |
135 | */ |
|
140 | */ | |
136 | /*! |
|
141 | /*! | |
137 | \qmlsignal AreaSeries::onBorderColorChanged(color color) |
|
142 | \qmlsignal AreaSeries::onBorderColorChanged(color color) | |
138 | Signal is emitted when the line (pen) color has changed to \a color. |
|
143 | Signal is emitted when the line (pen) color has changed to \a color. | |
139 | */ |
|
144 | */ | |
140 |
|
145 | |||
141 | /*! |
|
146 | /*! | |
142 | \fn void QAreaSeries::clicked(const QPointF& point) |
|
147 | \fn void QAreaSeries::clicked(const QPointF& point) | |
143 | \brief Signal is emitted when user clicks the \a point on area chart. |
|
148 | \brief Signal is emitted when user clicks the \a point on area chart. | |
144 | */ |
|
149 | */ | |
145 | /*! |
|
150 | /*! | |
146 | \qmlsignal AreaSeries::onClicked(QPointF point) |
|
151 | \qmlsignal AreaSeries::onClicked(QPointF point) | |
147 | Signal is emitted when user clicks the \a point on area chart. |
|
152 | Signal is emitted when user clicks the \a point on area chart. | |
148 | */ |
|
153 | */ | |
149 |
|
154 | |||
150 | /*! |
|
155 | /*! | |
151 | \fn void QAreaSeries::hovered(const QPointF &point, bool state) |
|
156 | \fn void QAreaSeries::hovered(const QPointF &point, bool state) | |
152 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) |
|
157 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) | |
153 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from |
|
158 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from | |
154 | the series. |
|
159 | the series. | |
155 | */ |
|
160 | */ | |
156 | /*! |
|
161 | /*! | |
157 | \qmlsignal AreaSeries::onHovered(point point, bool state) |
|
162 | \qmlsignal AreaSeries::onHovered(point point, bool state) | |
158 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) |
|
163 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) | |
159 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from |
|
164 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from | |
160 | the series. |
|
165 | the series. | |
161 | */ |
|
166 | */ | |
162 |
|
167 | |||
163 | /*! |
|
168 | /*! | |
164 | \fn void QAreaSeries::selected() |
|
169 | \fn void QAreaSeries::selected() | |
165 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be |
|
170 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be | |
166 | implemented by the user of QAreaSeries API. |
|
171 | implemented by the user of QAreaSeries API. | |
167 | */ |
|
172 | */ | |
168 | /*! |
|
173 | /*! | |
169 | \qmlsignal AreaSeries::onSelected() |
|
174 | \qmlsignal AreaSeries::onSelected() | |
170 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be |
|
175 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be | |
171 | implemented by the user of AreaSeries API. |
|
176 | implemented by the user of AreaSeries API. | |
172 | */ |
|
177 | */ | |
173 |
|
178 | |||
174 | /*! |
|
179 | /*! | |
175 | \fn void QAreaSeriesPrivate::updated() |
|
180 | \fn void QAreaSeriesPrivate::updated() | |
176 | \brief \internal |
|
181 | \brief \internal | |
177 | */ |
|
182 | */ | |
178 |
|
183 | |||
179 | /*! |
|
184 | /*! | |
180 | Constructs area series object which is a child of \a upperSeries. Area will be spanned between \a |
|
185 | Constructs area series object which is a child of \a upperSeries. Area will be spanned between \a | |
181 | upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead. |
|
186 | upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead. | |
182 | When series object is added to QChartView or QChart instance ownerships is transferred. |
|
187 | When series object is added to QChartView or QChart instance ownerships is transferred. | |
183 | */ |
|
188 | */ | |
184 | QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries) |
|
189 | QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries) | |
185 | : QAbstractSeries(*new QAreaSeriesPrivate(upperSeries, lowerSeries, this), upperSeries) |
|
190 | : QAbstractSeries(*new QAreaSeriesPrivate(upperSeries, lowerSeries, this), upperSeries) | |
186 | { |
|
191 | { | |
187 | } |
|
192 | } | |
188 |
|
193 | |||
189 | /*! |
|
194 | /*! | |
190 | Constructs area series object without upper or lower series with \a parent object. |
|
195 | Constructs area series object without upper or lower series with \a parent object. | |
191 | */ |
|
196 | */ | |
192 | QAreaSeries::QAreaSeries(QObject *parent) |
|
197 | QAreaSeries::QAreaSeries(QObject *parent) | |
193 | : QAbstractSeries(*new QAreaSeriesPrivate(0, 0, this), parent) |
|
198 | : QAbstractSeries(*new QAreaSeriesPrivate(0, 0, this), parent) | |
194 | { |
|
199 | { | |
195 | } |
|
200 | } | |
196 |
|
201 | |||
197 | /*! |
|
202 | /*! | |
198 | Destroys the object. |
|
203 | Destroys the object. | |
199 | */ |
|
204 | */ | |
200 | QAreaSeries::~QAreaSeries() |
|
205 | QAreaSeries::~QAreaSeries() | |
201 | { |
|
206 | { | |
202 | Q_D(QAreaSeries); |
|
207 | Q_D(QAreaSeries); | |
203 | if (d->m_chart) |
|
208 | if (d->m_chart) | |
204 | d->m_chart->removeSeries(this); |
|
209 | d->m_chart->removeSeries(this); | |
205 | } |
|
210 | } | |
206 |
|
211 | |||
207 | /*! |
|
212 | /*! | |
208 | Returns QAbstractSeries::SeriesTypeArea. |
|
213 | Returns QAbstractSeries::SeriesTypeArea. | |
209 | */ |
|
214 | */ | |
210 | QAbstractSeries::SeriesType QAreaSeries::type() const |
|
215 | QAbstractSeries::SeriesType QAreaSeries::type() const | |
211 | { |
|
216 | { | |
212 | return QAbstractSeries::SeriesTypeArea; |
|
217 | return QAbstractSeries::SeriesTypeArea; | |
213 | } |
|
218 | } | |
214 |
|
219 | |||
215 | /*! |
|
220 | /*! | |
216 | Sets the \a series that is to be used as the area chart upper series. |
|
221 | Sets the \a series that is to be used as the area chart upper series. | |
217 | */ |
|
222 | */ | |
218 | void QAreaSeries::setUpperSeries(QLineSeries *series) |
|
223 | void QAreaSeries::setUpperSeries(QLineSeries *series) | |
219 | { |
|
224 | { | |
220 | Q_D(QAreaSeries); |
|
225 | Q_D(QAreaSeries); | |
221 | if (d->m_upperSeries != series) |
|
226 | if (d->m_upperSeries != series) | |
222 | d->m_upperSeries = series; |
|
227 | d->m_upperSeries = series; | |
223 | } |
|
228 | } | |
224 |
|
229 | |||
225 | QLineSeries *QAreaSeries::upperSeries() const |
|
230 | QLineSeries *QAreaSeries::upperSeries() const | |
226 | { |
|
231 | { | |
227 | Q_D(const QAreaSeries); |
|
232 | Q_D(const QAreaSeries); | |
228 | return d->m_upperSeries; |
|
233 | return d->m_upperSeries; | |
229 | } |
|
234 | } | |
230 |
|
235 | |||
231 | /*! |
|
236 | /*! | |
232 | Sets the \a series that is to be used as the area chart lower series. |
|
237 | Sets the \a series that is to be used as the area chart lower series. | |
233 | */ |
|
238 | */ | |
234 | void QAreaSeries::setLowerSeries(QLineSeries *series) |
|
239 | void QAreaSeries::setLowerSeries(QLineSeries *series) | |
235 | { |
|
240 | { | |
236 | Q_D(QAreaSeries); |
|
241 | Q_D(QAreaSeries); | |
237 | d->m_lowerSeries = series; |
|
242 | d->m_lowerSeries = series; | |
238 | } |
|
243 | } | |
239 |
|
244 | |||
240 | QLineSeries *QAreaSeries::lowerSeries() const |
|
245 | QLineSeries *QAreaSeries::lowerSeries() const | |
241 | { |
|
246 | { | |
242 | Q_D(const QAreaSeries); |
|
247 | Q_D(const QAreaSeries); | |
243 | return d->m_lowerSeries; |
|
248 | return d->m_lowerSeries; | |
244 | } |
|
249 | } | |
245 |
|
250 | |||
246 | /*! |
|
251 | /*! | |
247 | Sets \a pen used for drawing area outline. |
|
252 | Sets \a pen used for drawing area outline. | |
248 | */ |
|
253 | */ | |
249 | void QAreaSeries::setPen(const QPen &pen) |
|
254 | void QAreaSeries::setPen(const QPen &pen) | |
250 | { |
|
255 | { | |
251 | Q_D(QAreaSeries); |
|
256 | Q_D(QAreaSeries); | |
252 | if (d->m_pen != pen) { |
|
257 | if (d->m_pen != pen) { | |
253 | d->m_pen = pen; |
|
258 | d->m_pen = pen; | |
254 | emit d->updated(); |
|
259 | emit d->updated(); | |
255 | } |
|
260 | } | |
256 | } |
|
261 | } | |
257 |
|
262 | |||
258 | QPen QAreaSeries::pen() const |
|
263 | QPen QAreaSeries::pen() const | |
259 | { |
|
264 | { | |
260 | Q_D(const QAreaSeries); |
|
265 | Q_D(const QAreaSeries); | |
261 | if (d->m_pen == QChartPrivate::defaultPen()) |
|
266 | if (d->m_pen == QChartPrivate::defaultPen()) | |
262 | return QPen(); |
|
267 | return QPen(); | |
263 | else |
|
268 | else | |
264 | return d->m_pen; |
|
269 | return d->m_pen; | |
265 | } |
|
270 | } | |
266 |
|
271 | |||
267 | /*! |
|
272 | /*! | |
268 | Sets \a brush used for filling the area. |
|
273 | Sets \a brush used for filling the area. | |
269 | */ |
|
274 | */ | |
270 | void QAreaSeries::setBrush(const QBrush &brush) |
|
275 | void QAreaSeries::setBrush(const QBrush &brush) | |
271 | { |
|
276 | { | |
272 | Q_D(QAreaSeries); |
|
277 | Q_D(QAreaSeries); | |
273 | if (d->m_brush != brush) { |
|
278 | if (d->m_brush != brush) { | |
274 | bool emitColorChanged = brush.color() != d->m_brush.color(); |
|
279 | bool emitColorChanged = brush.color() != d->m_brush.color(); | |
275 | d->m_brush = brush; |
|
280 | d->m_brush = brush; | |
276 | emit d->updated(); |
|
281 | emit d->updated(); | |
277 | if (emitColorChanged) |
|
282 | if (emitColorChanged) | |
278 | emit colorChanged(brush.color()); |
|
283 | emit colorChanged(brush.color()); | |
279 | } |
|
284 | } | |
280 | } |
|
285 | } | |
281 |
|
286 | |||
282 | QBrush QAreaSeries::brush() const |
|
287 | QBrush QAreaSeries::brush() const | |
283 | { |
|
288 | { | |
284 | Q_D(const QAreaSeries); |
|
289 | Q_D(const QAreaSeries); | |
285 | if (d->m_brush == QChartPrivate::defaultBrush()) |
|
290 | if (d->m_brush == QChartPrivate::defaultBrush()) | |
286 | return QBrush(); |
|
291 | return QBrush(); | |
287 | else |
|
292 | else | |
288 | return d->m_brush; |
|
293 | return d->m_brush; | |
289 | } |
|
294 | } | |
290 |
|
295 | |||
291 | void QAreaSeries::setColor(const QColor &color) |
|
296 | void QAreaSeries::setColor(const QColor &color) | |
292 | { |
|
297 | { | |
293 | QBrush b = brush(); |
|
298 | QBrush b = brush(); | |
294 | if (b == QBrush()) |
|
299 | if (b == QBrush()) | |
295 | b.setStyle(Qt::SolidPattern); |
|
300 | b.setStyle(Qt::SolidPattern); | |
296 | b.setColor(color); |
|
301 | b.setColor(color); | |
297 | setBrush(b); |
|
302 | setBrush(b); | |
298 | } |
|
303 | } | |
299 |
|
304 | |||
300 | QColor QAreaSeries::color() const |
|
305 | QColor QAreaSeries::color() const | |
301 | { |
|
306 | { | |
302 | return brush().color(); |
|
307 | return brush().color(); | |
303 | } |
|
308 | } | |
304 |
|
309 | |||
305 | void QAreaSeries::setBorderColor(const QColor &color) |
|
310 | void QAreaSeries::setBorderColor(const QColor &color) | |
306 | { |
|
311 | { | |
307 | QPen p = pen(); |
|
312 | QPen p = pen(); | |
308 | if (p.color() != color) { |
|
313 | if (p.color() != color) { | |
309 | p.setColor(color); |
|
314 | p.setColor(color); | |
310 | setPen(p); |
|
315 | setPen(p); | |
311 | emit borderColorChanged(color); |
|
316 | emit borderColorChanged(color); | |
312 | } |
|
317 | } | |
313 | } |
|
318 | } | |
314 |
|
319 | |||
315 | QColor QAreaSeries::borderColor() const |
|
320 | QColor QAreaSeries::borderColor() const | |
316 | { |
|
321 | { | |
317 | return pen().color(); |
|
322 | return pen().color(); | |
318 | } |
|
323 | } | |
319 |
|
324 | |||
320 | /*! |
|
325 | /*! | |
321 | Sets if data points are \a visible and should be drawn on line. |
|
326 | Sets if data points are \a visible and should be drawn on line. | |
322 | */ |
|
327 | */ | |
323 | void QAreaSeries::setPointsVisible(bool visible) |
|
328 | void QAreaSeries::setPointsVisible(bool visible) | |
324 | { |
|
329 | { | |
325 | Q_D(QAreaSeries); |
|
330 | Q_D(QAreaSeries); | |
326 | if (d->m_pointsVisible != visible) { |
|
331 | if (d->m_pointsVisible != visible) { | |
327 | d->m_pointsVisible = visible; |
|
332 | d->m_pointsVisible = visible; | |
328 | emit d->updated(); |
|
333 | emit d->updated(); | |
329 | } |
|
334 | } | |
330 | } |
|
335 | } | |
331 |
|
336 | |||
332 | /*! |
|
337 | /*! | |
333 | Returns if the points are drawn for this series. |
|
338 | Returns if the points are drawn for this series. | |
334 | \sa setPointsVisible() |
|
339 | \sa setPointsVisible() | |
335 | */ |
|
340 | */ | |
336 | bool QAreaSeries::pointsVisible() const |
|
341 | bool QAreaSeries::pointsVisible() const | |
337 | { |
|
342 | { | |
338 | Q_D(const QAreaSeries); |
|
343 | Q_D(const QAreaSeries); | |
339 | return d->m_pointsVisible; |
|
344 | return d->m_pointsVisible; | |
340 | } |
|
345 | } | |
341 |
|
346 | |||
342 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
347 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
343 |
|
348 | |||
344 | QAreaSeriesPrivate::QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q) |
|
349 | QAreaSeriesPrivate::QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q) | |
345 | : QAbstractSeriesPrivate(q), |
|
350 | : QAbstractSeriesPrivate(q), | |
346 | m_brush(QChartPrivate::defaultBrush()), |
|
351 | m_brush(QChartPrivate::defaultBrush()), | |
347 | m_pen(QChartPrivate::defaultPen()), |
|
352 | m_pen(QChartPrivate::defaultPen()), | |
348 | m_upperSeries(upperSeries), |
|
353 | m_upperSeries(upperSeries), | |
349 | m_lowerSeries(lowerSeries), |
|
354 | m_lowerSeries(lowerSeries), | |
350 | m_pointsVisible(false) |
|
355 | m_pointsVisible(false) | |
351 | { |
|
356 | { | |
352 | } |
|
357 | } | |
353 |
|
358 | |||
354 | void QAreaSeriesPrivate::initializeDomain() |
|
359 | void QAreaSeriesPrivate::initializeDomain() | |
355 | { |
|
360 | { | |
356 | Q_Q(QAreaSeries); |
|
361 | Q_Q(QAreaSeries); | |
357 |
|
362 | |||
358 | qreal minX(domain()->minX()); |
|
363 | qreal minX(domain()->minX()); | |
359 | qreal minY(domain()->minY()); |
|
364 | qreal minY(domain()->minY()); | |
360 | qreal maxX(domain()->maxX()); |
|
365 | qreal maxX(domain()->maxX()); | |
361 | qreal maxY(domain()->maxY()); |
|
366 | qreal maxY(domain()->maxY()); | |
362 |
|
367 | |||
363 | QLineSeries *upperSeries = q->upperSeries(); |
|
368 | QLineSeries *upperSeries = q->upperSeries(); | |
364 | QLineSeries *lowerSeries = q->lowerSeries(); |
|
369 | QLineSeries *lowerSeries = q->lowerSeries(); | |
365 |
|
370 | |||
366 | if (upperSeries) { |
|
371 | if (upperSeries) { | |
367 | const QList<QPointF>& points = upperSeries->points(); |
|
372 | const QList<QPointF>& points = upperSeries->points(); | |
368 |
|
373 | |||
369 | for (int i = 0; i < points.count(); i++) { |
|
374 | for (int i = 0; i < points.count(); i++) { | |
370 | qreal x = points[i].x(); |
|
375 | qreal x = points[i].x(); | |
371 | qreal y = points[i].y(); |
|
376 | qreal y = points[i].y(); | |
372 | minX = qMin(minX, x); |
|
377 | minX = qMin(minX, x); | |
373 | minY = qMin(minY, y); |
|
378 | minY = qMin(minY, y); | |
374 | maxX = qMax(maxX, x); |
|
379 | maxX = qMax(maxX, x); | |
375 | maxY = qMax(maxY, y); |
|
380 | maxY = qMax(maxY, y); | |
376 | } |
|
381 | } | |
377 | } |
|
382 | } | |
378 | if (lowerSeries) { |
|
383 | if (lowerSeries) { | |
379 |
|
384 | |||
380 | const QList<QPointF>& points = lowerSeries->points(); |
|
385 | const QList<QPointF>& points = lowerSeries->points(); | |
381 |
|
386 | |||
382 | for (int i = 0; i < points.count(); i++) { |
|
387 | for (int i = 0; i < points.count(); i++) { | |
383 | qreal x = points[i].x(); |
|
388 | qreal x = points[i].x(); | |
384 | qreal y = points[i].y(); |
|
389 | qreal y = points[i].y(); | |
385 | minX = qMin(minX, x); |
|
390 | minX = qMin(minX, x); | |
386 | minY = qMin(minY, y); |
|
391 | minY = qMin(minY, y); | |
387 | maxX = qMax(maxX, x); |
|
392 | maxX = qMax(maxX, x); | |
388 | maxY = qMax(maxY, y); |
|
393 | maxY = qMax(maxY, y); | |
389 | } |
|
394 | } | |
390 | } |
|
395 | } | |
391 |
|
396 | |||
392 | domain()->setRange(minX, maxX, minY, maxY); |
|
397 | domain()->setRange(minX, maxX, minY, maxY); | |
393 | } |
|
398 | } | |
394 |
|
399 | |||
395 | void QAreaSeriesPrivate::initializeGraphics(QGraphicsItem* parent) |
|
400 | void QAreaSeriesPrivate::initializeGraphics(QGraphicsItem* parent) | |
396 | { |
|
401 | { | |
397 | Q_Q(QAreaSeries); |
|
402 | Q_Q(QAreaSeries); | |
398 | AreaChartItem *area = new AreaChartItem(q,parent); |
|
403 | AreaChartItem *area = new AreaChartItem(q,parent); | |
399 | m_item.reset(area); |
|
404 | m_item.reset(area); | |
400 | QAbstractSeriesPrivate::initializeGraphics(parent); |
|
405 | QAbstractSeriesPrivate::initializeGraphics(parent); | |
401 | } |
|
406 | } | |
402 | void QAreaSeriesPrivate::initializeAnimations(QChart::AnimationOptions options) |
|
407 | void QAreaSeriesPrivate::initializeAnimations(QChart::AnimationOptions options) | |
403 | { |
|
408 | { | |
404 | Q_Q(QAreaSeries); |
|
409 | Q_Q(QAreaSeries); | |
405 | AreaChartItem *area = static_cast<AreaChartItem *>(m_item.data()); |
|
410 | AreaChartItem *area = static_cast<AreaChartItem *>(m_item.data()); | |
406 |
|
411 | |||
407 | if (q->upperSeries() && area->upperLineItem()->animation()) |
|
412 | if (q->upperSeries() && area->upperLineItem()->animation()) | |
408 | area->upperLineItem()->animation()->stopAndDestroyLater(); |
|
413 | area->upperLineItem()->animation()->stopAndDestroyLater(); | |
409 | if (q->lowerSeries() && area->lowerLineItem()->animation()) |
|
414 | if (q->lowerSeries() && area->lowerLineItem()->animation()) | |
410 | area->lowerLineItem()->animation()->stopAndDestroyLater(); |
|
415 | area->lowerLineItem()->animation()->stopAndDestroyLater(); | |
411 |
|
416 | |||
412 | if (options.testFlag(QChart::SeriesAnimations)) { |
|
417 | if (options.testFlag(QChart::SeriesAnimations)) { | |
413 | area->upperLineItem()->setAnimation(new XYAnimation(area->upperLineItem())); |
|
418 | area->upperLineItem()->setAnimation(new XYAnimation(area->upperLineItem())); | |
414 | if (q->lowerSeries()) |
|
419 | if (q->lowerSeries()) | |
415 | area->lowerLineItem()->setAnimation(new XYAnimation(area->lowerLineItem())); |
|
420 | area->lowerLineItem()->setAnimation(new XYAnimation(area->lowerLineItem())); | |
416 | } else { |
|
421 | } else { | |
417 | if (q->upperSeries()) |
|
422 | if (q->upperSeries()) | |
418 | area->upperLineItem()->setAnimation(0); |
|
423 | area->upperLineItem()->setAnimation(0); | |
419 | if (q->lowerSeries()) |
|
424 | if (q->lowerSeries()) | |
420 | area->lowerLineItem()->setAnimation(0); |
|
425 | area->lowerLineItem()->setAnimation(0); | |
421 | } |
|
426 | } | |
422 | QAbstractSeriesPrivate::initializeAnimations(options); |
|
427 | QAbstractSeriesPrivate::initializeAnimations(options); | |
423 | } |
|
428 | } | |
424 |
|
429 | |||
425 | QList<QLegendMarker*> QAreaSeriesPrivate::createLegendMarkers(QLegend* legend) |
|
430 | QList<QLegendMarker*> QAreaSeriesPrivate::createLegendMarkers(QLegend* legend) | |
426 | { |
|
431 | { | |
427 | Q_Q(QAreaSeries); |
|
432 | Q_Q(QAreaSeries); | |
428 | QList<QLegendMarker*> list; |
|
433 | QList<QLegendMarker*> list; | |
429 | return list << new QAreaLegendMarker(q,legend); |
|
434 | return list << new QAreaLegendMarker(q,legend); | |
430 | } |
|
435 | } | |
431 |
|
436 | |||
432 |
|
437 | |||
433 | void QAreaSeriesPrivate::initializeAxes() |
|
438 | void QAreaSeriesPrivate::initializeAxes() | |
434 | { |
|
439 | { | |
435 |
|
440 | |||
436 | } |
|
441 | } | |
437 |
|
442 | |||
438 | QAbstractAxis::AxisType QAreaSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const |
|
443 | QAbstractAxis::AxisType QAreaSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const | |
439 | { |
|
444 | { | |
440 | Q_UNUSED(orientation); |
|
445 | Q_UNUSED(orientation); | |
441 | return QAbstractAxis::AxisTypeValue; |
|
446 | return QAbstractAxis::AxisTypeValue; | |
442 | } |
|
447 | } | |
443 |
|
448 | |||
444 | QAbstractAxis* QAreaSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const |
|
449 | QAbstractAxis* QAreaSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const | |
445 | { |
|
450 | { | |
446 | Q_UNUSED(orientation); |
|
451 | Q_UNUSED(orientation); | |
447 | return new QValueAxis; |
|
452 | return new QValueAxis; | |
448 | } |
|
453 | } | |
449 |
|
454 | |||
450 | void QAreaSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) |
|
455 | void QAreaSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) | |
451 | { |
|
456 | { | |
452 | Q_Q(QAreaSeries); |
|
457 | Q_Q(QAreaSeries); | |
453 |
|
458 | |||
454 | const QList<QGradient> gradients = theme->seriesGradients(); |
|
459 | const QList<QGradient> gradients = theme->seriesGradients(); | |
455 | const QList<QColor> colors = theme->seriesColors(); |
|
460 | const QList<QColor> colors = theme->seriesColors(); | |
456 |
|
461 | |||
457 | if (forced || QChartPrivate::defaultPen() == m_pen) { |
|
462 | if (forced || QChartPrivate::defaultPen() == m_pen) { | |
458 | QPen pen; |
|
463 | QPen pen; | |
459 | pen.setColor(ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.0)); |
|
464 | pen.setColor(ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.0)); | |
460 | pen.setWidthF(2); |
|
465 | pen.setWidthF(2); | |
461 | q->setPen(pen); |
|
466 | q->setPen(pen); | |
462 | } |
|
467 | } | |
463 |
|
468 | |||
464 | if (forced || QChartPrivate::defaultBrush() == m_brush) { |
|
469 | if (forced || QChartPrivate::defaultBrush() == m_brush) { | |
465 | QBrush brush(colors.at(index % colors.size())); |
|
470 | QBrush brush(colors.at(index % colors.size())); | |
466 | q->setBrush(brush); |
|
471 | q->setBrush(brush); | |
467 | } |
|
472 | } | |
468 | } |
|
473 | } | |
469 |
|
474 | |||
470 |
|
475 | |||
471 | #include "moc_qareaseries.cpp" |
|
476 | #include "moc_qareaseries.cpp" | |
472 | #include "moc_qareaseries_p.cpp" |
|
477 | #include "moc_qareaseries_p.cpp" | |
473 |
|
478 | |||
474 | QTCOMMERCIALCHART_END_NAMESPACE |
|
479 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,673 +1,678 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qbarset.h" |
|
21 | #include "qbarset.h" | |
22 | #include "qbarset_p.h" |
|
22 | #include "qbarset_p.h" | |
23 | #include "charthelpers_p.h" |
|
23 | #include "charthelpers_p.h" | |
24 | #include "qchart_p.h" |
|
24 | #include "qchart_p.h" | |
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
26 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
27 |
|
27 | |||
28 | /*! |
|
28 | /*! | |
29 | \class QBarSet |
|
29 | \class QBarSet | |
30 | \inmodule Qt Charts |
|
30 | \inmodule Qt Charts | |
31 | \brief Building block for different bar charts. |
|
31 | \brief Building block for different bar charts. | |
32 |
|
32 | |||
33 | QBarSet represents one set of bars. Set of bars contains one data value for each category. |
|
33 | QBarSet represents one set of bars. Set of bars contains one data value for each category. | |
34 | First value of set is assumed to belong to first category, second to second category and so on. |
|
34 | First value of set is assumed to belong to first category, second to second category and so on. | |
35 | If set has fewer values than there are categories, then the missing values are assumed to be |
|
35 | If set has fewer values than there are categories, then the missing values are assumed to be | |
36 | at the end of set. For missing values in middle of a set, numerical value of zero is used. |
|
36 | at the end of set. For missing values in middle of a set, numerical value of zero is used. | |
37 |
|
37 | |||
38 | \mainclass |
|
38 | \mainclass | |
39 |
|
39 | |||
40 | \sa QAbstractBarSeries, QBarSeries, QStackedBarSeries, QPercentBarSeries |
|
40 | \sa QAbstractBarSeries, QBarSeries, QStackedBarSeries, QPercentBarSeries | |
41 | */ |
|
41 | */ | |
42 | #ifdef QDOC_QT5 |
|
42 | #ifdef QDOC_QT5 | |
43 | /*! |
|
43 | /*! | |
44 | \qmltype BarSet |
|
44 | \qmltype BarSet | |
45 | \instantiates QBarSet |
|
45 | \instantiates QBarSet | |
46 | \inqmlmodule QtCommercial.Chart |
|
46 | \inqmlmodule QtCommercial.Chart | |
47 |
|
47 | |||
48 | \include doc/src/barset.qdocinc |
|
48 | \include doc/src/barset.qdocinc | |
49 | */ |
|
49 | */ | |
50 | #else |
|
50 | #else | |
51 | /*! |
|
51 | /*! | |
52 | \qmlclass BarSet QBarSet |
|
52 | \qmlclass BarSet QBarSet | |
53 |
|
53 | |||
54 | \include ../doc/src/barset.qdocinc |
|
54 | \include ../doc/src/barset.qdocinc | |
55 | */ |
|
55 | */ | |
56 | #endif |
|
56 | #endif | |
57 |
|
57 | |||
58 | /*! |
|
58 | /*! | |
59 | \property QBarSet::label |
|
59 | \property QBarSet::label | |
60 | Defines the label of the bar set. |
|
60 | Defines the label of the bar set. | |
61 | */ |
|
61 | */ | |
62 | /*! |
|
62 | /*! | |
63 | \qmlproperty string BarSet::label |
|
63 | \qmlproperty string BarSet::label | |
64 | Defines the label of the bar set. |
|
64 | Defines the label of the bar set. | |
65 | */ |
|
65 | */ | |
66 |
|
66 | |||
67 | /*! |
|
67 | /*! | |
68 | \property QBarSet::pen |
|
68 | \property QBarSet::pen | |
69 | \brief Defines the pen used by the bar set. |
|
69 | \brief Defines the pen used by the bar set. | |
70 | */ |
|
70 | */ | |
71 |
|
71 | |||
72 | /*! |
|
72 | /*! | |
73 | \property QBarSet::brush |
|
73 | \property QBarSet::brush | |
74 | \brief Defines the brush used by the bar set. |
|
74 | \brief Defines the brush used by the bar set. | |
75 | */ |
|
75 | */ | |
76 |
|
76 | |||
77 | /*! |
|
77 | /*! | |
|
78 | \qmlproperty QString BarSet::brushFilename | |||
|
79 | The name of the file used as a brush for the set. | |||
|
80 | */ | |||
|
81 | ||||
|
82 | /*! | |||
78 | \property QBarSet::labelBrush |
|
83 | \property QBarSet::labelBrush | |
79 | \brief Defines the brush used by the bar set's label. |
|
84 | \brief Defines the brush used by the bar set's label. | |
80 | */ |
|
85 | */ | |
81 |
|
86 | |||
82 | /*! |
|
87 | /*! | |
83 | \property QBarSet::labelFont |
|
88 | \property QBarSet::labelFont | |
84 | \brief Defines the font used by the bar set's label. |
|
89 | \brief Defines the font used by the bar set's label. | |
85 | */ |
|
90 | */ | |
86 |
|
91 | |||
87 | /*! |
|
92 | /*! | |
88 | \qmlproperty Font BarSet::labelFont |
|
93 | \qmlproperty Font BarSet::labelFont | |
89 | Defines the font used by the bar set's label. |
|
94 | Defines the font used by the bar set's label. | |
90 |
|
95 | |||
91 | See the Qt documentation for more details of Font. |
|
96 | See the Qt documentation for more details of Font. | |
92 | */ |
|
97 | */ | |
93 |
|
98 | |||
94 | /*! |
|
99 | /*! | |
95 | \property QBarSet::color |
|
100 | \property QBarSet::color | |
96 | The fill (brush) color of the bar set. |
|
101 | The fill (brush) color of the bar set. | |
97 | */ |
|
102 | */ | |
98 | /*! |
|
103 | /*! | |
99 | \qmlproperty color BarSet::color |
|
104 | \qmlproperty color BarSet::color | |
100 | The fill (brush) color of the bar set. |
|
105 | The fill (brush) color of the bar set. | |
101 | */ |
|
106 | */ | |
102 |
|
107 | |||
103 | /*! |
|
108 | /*! | |
104 | \property QBarSet::borderColor |
|
109 | \property QBarSet::borderColor | |
105 | The line (pen) color of the bar set. |
|
110 | The line (pen) color of the bar set. | |
106 | */ |
|
111 | */ | |
107 | /*! |
|
112 | /*! | |
108 | \qmlproperty color BarSet::borderColor |
|
113 | \qmlproperty color BarSet::borderColor | |
109 | The line (pen) color of the bar set. |
|
114 | The line (pen) color of the bar set. | |
110 | */ |
|
115 | */ | |
111 |
|
116 | |||
112 | /*! |
|
117 | /*! | |
113 | \qmlproperty real BarSet::borderWidth |
|
118 | \qmlproperty real BarSet::borderWidth | |
114 | The width of the border line. By default the width is 2.0. |
|
119 | The width of the border line. By default the width is 2.0. | |
115 | */ |
|
120 | */ | |
116 |
|
121 | |||
117 | /*! |
|
122 | /*! | |
118 | \property QBarSet::labelColor |
|
123 | \property QBarSet::labelColor | |
119 | The text (label) color of the bar set. |
|
124 | The text (label) color of the bar set. | |
120 | */ |
|
125 | */ | |
121 | /*! |
|
126 | /*! | |
122 | \qmlproperty color BarSet::labelColor |
|
127 | \qmlproperty color BarSet::labelColor | |
123 | The text (label) color of the bar set. |
|
128 | The text (label) color of the bar set. | |
124 | */ |
|
129 | */ | |
125 |
|
130 | |||
126 | /*! |
|
131 | /*! | |
127 | \fn void QBarSet::clicked(int index) |
|
132 | \fn void QBarSet::clicked(int index) | |
128 |
|
133 | |||
129 | The signal is emitted if the user clicks with a mouse on top of bar set. |
|
134 | The signal is emitted if the user clicks with a mouse on top of bar set. | |
130 | Clicked bar inside set is indexed by \a index |
|
135 | Clicked bar inside set is indexed by \a index | |
131 | */ |
|
136 | */ | |
132 |
|
137 | |||
133 | /*! |
|
138 | /*! | |
134 | \fn void QBarSet::hovered(bool status) |
|
139 | \fn void QBarSet::hovered(bool status) | |
135 |
|
140 | |||
136 | The signal is emitted if mouse is hovered on top of bar set. |
|
141 | The signal is emitted if mouse is hovered on top of bar set. | |
137 | Parameter \a status is true, if mouse entered on top of bar set, false if mouse left from top of bar set. |
|
142 | Parameter \a status is true, if mouse entered on top of bar set, false if mouse left from top of bar set. | |
138 | */ |
|
143 | */ | |
139 |
|
144 | |||
140 | /*! |
|
145 | /*! | |
141 | \fn void QBarSet::hovered(bool status, int index) |
|
146 | \fn void QBarSet::hovered(bool status, int index) | |
142 |
|
147 | |||
143 | The signal is emitted if mouse is hovered on top of bar set. |
|
148 | The signal is emitted if mouse is hovered on top of bar set. | |
144 | Parameter \a status is true, if mouse entered on top of bar set, false if mouse left from top of bar set. |
|
149 | Parameter \a status is true, if mouse entered on top of bar set, false if mouse left from top of bar set. | |
145 | Hovered bar inside the set is indexed by \a index. |
|
150 | Hovered bar inside the set is indexed by \a index. | |
146 | */ |
|
151 | */ | |
147 |
|
152 | |||
148 |
|
153 | |||
149 | /*! |
|
154 | /*! | |
150 | \fn void QBarSet::labelChanged() |
|
155 | \fn void QBarSet::labelChanged() | |
151 | This signal is emitted when the label of the bar set has changed. |
|
156 | This signal is emitted when the label of the bar set has changed. | |
152 | \sa label |
|
157 | \sa label | |
153 | */ |
|
158 | */ | |
154 | /*! |
|
159 | /*! | |
155 | \qmlsignal BarSet::onLabelChanged() |
|
160 | \qmlsignal BarSet::onLabelChanged() | |
156 | This signal is emitted when the label of the bar set has changed. |
|
161 | This signal is emitted when the label of the bar set has changed. | |
157 | */ |
|
162 | */ | |
158 |
|
163 | |||
159 | /*! |
|
164 | /*! | |
160 | \fn void QBarSet::penChanged() |
|
165 | \fn void QBarSet::penChanged() | |
161 | This signal is emitted when the pen of the bar set has changed. |
|
166 | This signal is emitted when the pen of the bar set has changed. | |
162 | \sa pen |
|
167 | \sa pen | |
163 | */ |
|
168 | */ | |
164 |
|
169 | |||
165 | /*! |
|
170 | /*! | |
166 | \fn void QBarSet::brushChanged() |
|
171 | \fn void QBarSet::brushChanged() | |
167 | This signal is emitted when the brush of the bar set has changed. |
|
172 | This signal is emitted when the brush of the bar set has changed. | |
168 | \sa brush |
|
173 | \sa brush | |
169 | */ |
|
174 | */ | |
170 |
|
175 | |||
171 | /*! |
|
176 | /*! | |
172 | \fn void QBarSet::labelBrushChanged() |
|
177 | \fn void QBarSet::labelBrushChanged() | |
173 | This signal is emitted when the brush of the bar set's label has changed. |
|
178 | This signal is emitted when the brush of the bar set's label has changed. | |
174 | \sa labelBrush |
|
179 | \sa labelBrush | |
175 | */ |
|
180 | */ | |
176 |
|
181 | |||
177 | /*! |
|
182 | /*! | |
178 | \fn void QBarSet::labelFontChanged() |
|
183 | \fn void QBarSet::labelFontChanged() | |
179 | This signal is emitted when the font of the bar set's label has changed. |
|
184 | This signal is emitted when the font of the bar set's label has changed. | |
180 | \sa labelBrush |
|
185 | \sa labelBrush | |
181 | */ |
|
186 | */ | |
182 |
|
187 | |||
183 | /*! |
|
188 | /*! | |
184 | \fn void QBarSet::colorChanged(QColor) |
|
189 | \fn void QBarSet::colorChanged(QColor) | |
185 | This signal is emitted when the fill (brush) color of the set has changed to \a color. |
|
190 | This signal is emitted when the fill (brush) color of the set has changed to \a color. | |
186 | */ |
|
191 | */ | |
187 | /*! |
|
192 | /*! | |
188 | \qmlsignal BarSet::onColorChanged(color color) |
|
193 | \qmlsignal BarSet::onColorChanged(color color) | |
189 | This signal is emitted when the fill (brush) color of the set has changed to \a color. |
|
194 | This signal is emitted when the fill (brush) color of the set has changed to \a color. | |
190 | */ |
|
195 | */ | |
191 |
|
196 | |||
192 | /*! |
|
197 | /*! | |
193 | \fn void QBarSet::borderColorChanged(QColor) |
|
198 | \fn void QBarSet::borderColorChanged(QColor) | |
194 | This signal is emitted when the line (pen) color of the set has changed to \a color. |
|
199 | This signal is emitted when the line (pen) color of the set has changed to \a color. | |
195 | */ |
|
200 | */ | |
196 | /*! |
|
201 | /*! | |
197 | \qmlsignal BarSet::onBorderColorChanged(color color) |
|
202 | \qmlsignal BarSet::onBorderColorChanged(color color) | |
198 | This signal is emitted when the line (pen) color of the set has changed to \a color. |
|
203 | This signal is emitted when the line (pen) color of the set has changed to \a color. | |
199 | */ |
|
204 | */ | |
200 |
|
205 | |||
201 | /*! |
|
206 | /*! | |
202 | \fn void QBarSet::labelColorChanged(QColor) |
|
207 | \fn void QBarSet::labelColorChanged(QColor) | |
203 | This signal is emitted when the text (label) color of the set has changed to \a color. |
|
208 | This signal is emitted when the text (label) color of the set has changed to \a color. | |
204 | */ |
|
209 | */ | |
205 | /*! |
|
210 | /*! | |
206 | \qmlsignal BarSet::onLabelColorChanged(color color) |
|
211 | \qmlsignal BarSet::onLabelColorChanged(color color) | |
207 | This signal is emitted when the text (label) color of the set has changed to \a color. |
|
212 | This signal is emitted when the text (label) color of the set has changed to \a color. | |
208 | */ |
|
213 | */ | |
209 |
|
214 | |||
210 | /*! |
|
215 | /*! | |
211 | \fn void QBarSet::valuesAdded(int index, int count) |
|
216 | \fn void QBarSet::valuesAdded(int index, int count) | |
212 | This signal is emitted when new values have been added to the set. |
|
217 | This signal is emitted when new values have been added to the set. | |
213 | Parameter \a index indicates the position of the first inserted value. |
|
218 | Parameter \a index indicates the position of the first inserted value. | |
214 | Parameter \a count is the number of inserted values. |
|
219 | Parameter \a count is the number of inserted values. | |
215 | \sa append(), insert() |
|
220 | \sa append(), insert() | |
216 | */ |
|
221 | */ | |
217 | /*! |
|
222 | /*! | |
218 | \qmlsignal BarSet::onValuesAdded(int index, int count) |
|
223 | \qmlsignal BarSet::onValuesAdded(int index, int count) | |
219 | This signal is emitted when new values have been added to the set. |
|
224 | This signal is emitted when new values have been added to the set. | |
220 | Parameter \a index indicates the position of the first inserted value. |
|
225 | Parameter \a index indicates the position of the first inserted value. | |
221 | Parameter \a count is the number of inserted values. |
|
226 | Parameter \a count is the number of inserted values. | |
222 | */ |
|
227 | */ | |
223 |
|
228 | |||
224 | /*! |
|
229 | /*! | |
225 | \fn void QBarSet::valuesRemoved(int index, int count) |
|
230 | \fn void QBarSet::valuesRemoved(int index, int count) | |
226 | This signal is emitted values have been removed from the set. |
|
231 | This signal is emitted values have been removed from the set. | |
227 | Parameter \a index indicates the position of the first removed value. |
|
232 | Parameter \a index indicates the position of the first removed value. | |
228 | Parameter \a count is the number of removed values. |
|
233 | Parameter \a count is the number of removed values. | |
229 | \sa remove() |
|
234 | \sa remove() | |
230 | */ |
|
235 | */ | |
231 | /*! |
|
236 | /*! | |
232 | \qmlsignal BarSet::onValuesRemoved(int index, int count) |
|
237 | \qmlsignal BarSet::onValuesRemoved(int index, int count) | |
233 | This signal is emitted values have been removed from the set. |
|
238 | This signal is emitted values have been removed from the set. | |
234 | Parameter \a index indicates the position of the first removed value. |
|
239 | Parameter \a index indicates the position of the first removed value. | |
235 | Parameter \a count is the number of removed values. |
|
240 | Parameter \a count is the number of removed values. | |
236 | */ |
|
241 | */ | |
237 |
|
242 | |||
238 | /*! |
|
243 | /*! | |
239 | \fn void QBarSet::valueChanged(int index) |
|
244 | \fn void QBarSet::valueChanged(int index) | |
240 | This signal is emitted values the value in the set has been modified. |
|
245 | This signal is emitted values the value in the set has been modified. | |
241 | Parameter \a index indicates the position of the modified value. |
|
246 | Parameter \a index indicates the position of the modified value. | |
242 | \sa at() |
|
247 | \sa at() | |
243 | */ |
|
248 | */ | |
244 | /*! |
|
249 | /*! | |
245 | \qmlsignal BarSet::onValueChanged(int index) |
|
250 | \qmlsignal BarSet::onValueChanged(int index) | |
246 | This signal is emitted values the value in the set has been modified. |
|
251 | This signal is emitted values the value in the set has been modified. | |
247 | Parameter \a index indicates the position of the modified value. |
|
252 | Parameter \a index indicates the position of the modified value. | |
248 | */ |
|
253 | */ | |
249 |
|
254 | |||
250 | /*! |
|
255 | /*! | |
251 | \qmlproperty int BarSet::count |
|
256 | \qmlproperty int BarSet::count | |
252 | The count of values on the bar set |
|
257 | The count of values on the bar set | |
253 | */ |
|
258 | */ | |
254 |
|
259 | |||
255 | /*! |
|
260 | /*! | |
256 | \qmlproperty QVariantList BarSet::values |
|
261 | \qmlproperty QVariantList BarSet::values | |
257 | The values of the bar set. You can set either a list of reals or a list of points as values. If you set a list of |
|
262 | The values of the bar set. You can set either a list of reals or a list of points as values. If you set a list of | |
258 | reals as values, the values are automatically completed to points by using the index of a value as it's |
|
263 | reals as values, the values are automatically completed to points by using the index of a value as it's | |
259 | x-coordinate. For example the following sets have equal values: |
|
264 | x-coordinate. For example the following sets have equal values: | |
260 | \code |
|
265 | \code | |
261 | myBarSet1.values = [0, 5, 1, 5]; |
|
266 | myBarSet1.values = [0, 5, 1, 5]; | |
262 | myBarSet2.values = [Qt.point(0, 0), Qt.point(1, 5), Qt.point(2, 1), Qt.point(3, 5)]; |
|
267 | myBarSet2.values = [Qt.point(0, 0), Qt.point(1, 5), Qt.point(2, 1), Qt.point(3, 5)]; | |
263 | \endcode |
|
268 | \endcode | |
264 | */ |
|
269 | */ | |
265 |
|
270 | |||
266 | /*! |
|
271 | /*! | |
267 | Constructs QBarSet with a label of \a label and with parent of \a parent. |
|
272 | Constructs QBarSet with a label of \a label and with parent of \a parent. | |
268 | */ |
|
273 | */ | |
269 | QBarSet::QBarSet(const QString label, QObject *parent) |
|
274 | QBarSet::QBarSet(const QString label, QObject *parent) | |
270 | : QObject(parent), |
|
275 | : QObject(parent), | |
271 | d_ptr(new QBarSetPrivate(label, this)) |
|
276 | d_ptr(new QBarSetPrivate(label, this)) | |
272 | { |
|
277 | { | |
273 | } |
|
278 | } | |
274 |
|
279 | |||
275 | /*! |
|
280 | /*! | |
276 | Destroys the bar set. |
|
281 | Destroys the bar set. | |
277 | */ |
|
282 | */ | |
278 | QBarSet::~QBarSet() |
|
283 | QBarSet::~QBarSet() | |
279 | { |
|
284 | { | |
280 | // NOTE: d_ptr destroyed by QObject |
|
285 | // NOTE: d_ptr destroyed by QObject | |
281 | } |
|
286 | } | |
282 |
|
287 | |||
283 | /*! |
|
288 | /*! | |
284 | Sets new \a label for set. |
|
289 | Sets new \a label for set. | |
285 | */ |
|
290 | */ | |
286 | void QBarSet::setLabel(const QString label) |
|
291 | void QBarSet::setLabel(const QString label) | |
287 | { |
|
292 | { | |
288 | d_ptr->m_label = label; |
|
293 | d_ptr->m_label = label; | |
289 | emit labelChanged(); |
|
294 | emit labelChanged(); | |
290 | } |
|
295 | } | |
291 |
|
296 | |||
292 | /*! |
|
297 | /*! | |
293 | Returns label of the set. |
|
298 | Returns label of the set. | |
294 | */ |
|
299 | */ | |
295 | QString QBarSet::label() const |
|
300 | QString QBarSet::label() const | |
296 | { |
|
301 | { | |
297 | return d_ptr->m_label; |
|
302 | return d_ptr->m_label; | |
298 | } |
|
303 | } | |
299 |
|
304 | |||
300 | /*! |
|
305 | /*! | |
301 | Appends new value \a value to the end of set. |
|
306 | Appends new value \a value to the end of set. | |
302 | */ |
|
307 | */ | |
303 | void QBarSet::append(const qreal value) |
|
308 | void QBarSet::append(const qreal value) | |
304 | { |
|
309 | { | |
305 | // Convert to QPointF |
|
310 | // Convert to QPointF | |
306 | int index = d_ptr->m_values.count(); |
|
311 | int index = d_ptr->m_values.count(); | |
307 | d_ptr->append(QPointF(d_ptr->m_values.count(), value)); |
|
312 | d_ptr->append(QPointF(d_ptr->m_values.count(), value)); | |
308 | emit valuesAdded(index, 1); |
|
313 | emit valuesAdded(index, 1); | |
309 | } |
|
314 | } | |
310 |
|
315 | |||
311 | /*! |
|
316 | /*! | |
312 | Appends a list of reals to set. Works like append with single real value. The \a values in list |
|
317 | Appends a list of reals to set. Works like append with single real value. The \a values in list | |
313 | are appended to end of bar set. |
|
318 | are appended to end of bar set. | |
314 | \sa append() |
|
319 | \sa append() | |
315 | */ |
|
320 | */ | |
316 | void QBarSet::append(const QList<qreal> &values) |
|
321 | void QBarSet::append(const QList<qreal> &values) | |
317 | { |
|
322 | { | |
318 | int index = d_ptr->m_values.count(); |
|
323 | int index = d_ptr->m_values.count(); | |
319 | d_ptr->append(values); |
|
324 | d_ptr->append(values); | |
320 | emit valuesAdded(index, values.count()); |
|
325 | emit valuesAdded(index, values.count()); | |
321 | } |
|
326 | } | |
322 |
|
327 | |||
323 | /*! |
|
328 | /*! | |
324 | Convenience operator. Same as append, with real \a value. |
|
329 | Convenience operator. Same as append, with real \a value. | |
325 | \sa append() |
|
330 | \sa append() | |
326 | */ |
|
331 | */ | |
327 | QBarSet &QBarSet::operator << (const qreal &value) |
|
332 | QBarSet &QBarSet::operator << (const qreal &value) | |
328 | { |
|
333 | { | |
329 | append(value); |
|
334 | append(value); | |
330 | return *this; |
|
335 | return *this; | |
331 | } |
|
336 | } | |
332 |
|
337 | |||
333 | /*! |
|
338 | /*! | |
334 | Inserts new \a value on the \a index position. |
|
339 | Inserts new \a value on the \a index position. | |
335 | The value that is currently at this postion is moved to position index + 1 |
|
340 | The value that is currently at this postion is moved to position index + 1 | |
336 | \sa remove() |
|
341 | \sa remove() | |
337 | */ |
|
342 | */ | |
338 | void QBarSet::insert(const int index, const qreal value) |
|
343 | void QBarSet::insert(const int index, const qreal value) | |
339 | { |
|
344 | { | |
340 | d_ptr->insert(index, value); |
|
345 | d_ptr->insert(index, value); | |
341 | emit valuesAdded(index, 1); |
|
346 | emit valuesAdded(index, 1); | |
342 | } |
|
347 | } | |
343 |
|
348 | |||
344 | /*! |
|
349 | /*! | |
345 | Removes \a count number of values from the set starting at \a index. |
|
350 | Removes \a count number of values from the set starting at \a index. | |
346 | \sa insert() |
|
351 | \sa insert() | |
347 | */ |
|
352 | */ | |
348 | void QBarSet::remove(const int index, const int count) |
|
353 | void QBarSet::remove(const int index, const int count) | |
349 | { |
|
354 | { | |
350 | int removedCount = d_ptr->remove(index, count); |
|
355 | int removedCount = d_ptr->remove(index, count); | |
351 | if (removedCount > 0) |
|
356 | if (removedCount > 0) | |
352 | emit valuesRemoved(index, removedCount); |
|
357 | emit valuesRemoved(index, removedCount); | |
353 | return; |
|
358 | return; | |
354 | } |
|
359 | } | |
355 |
|
360 | |||
356 | /*! |
|
361 | /*! | |
357 | Sets a new value \a value to set, indexed by \a index. |
|
362 | Sets a new value \a value to set, indexed by \a index. | |
358 | */ |
|
363 | */ | |
359 | void QBarSet::replace(const int index, const qreal value) |
|
364 | void QBarSet::replace(const int index, const qreal value) | |
360 | { |
|
365 | { | |
361 | if (index >= 0 && index < d_ptr->m_values.count()) { |
|
366 | if (index >= 0 && index < d_ptr->m_values.count()) { | |
362 | d_ptr->replace(index, value); |
|
367 | d_ptr->replace(index, value); | |
363 | emit valueChanged(index); |
|
368 | emit valueChanged(index); | |
364 | } |
|
369 | } | |
365 | } |
|
370 | } | |
366 |
|
371 | |||
367 |
|
372 | |||
368 | /*! |
|
373 | /*! | |
369 | Returns value of set indexed by \a index. |
|
374 | Returns value of set indexed by \a index. | |
370 | If the index is out of bounds 0.0 is returned. |
|
375 | If the index is out of bounds 0.0 is returned. | |
371 | */ |
|
376 | */ | |
372 | qreal QBarSet::at(const int index) const |
|
377 | qreal QBarSet::at(const int index) const | |
373 | { |
|
378 | { | |
374 | if (index < 0 || index >= d_ptr->m_values.count()) |
|
379 | if (index < 0 || index >= d_ptr->m_values.count()) | |
375 | return 0; |
|
380 | return 0; | |
376 | return d_ptr->m_values.at(index).y(); |
|
381 | return d_ptr->m_values.at(index).y(); | |
377 | } |
|
382 | } | |
378 |
|
383 | |||
379 | /*! |
|
384 | /*! | |
380 | Returns value of set indexed by \a index. |
|
385 | Returns value of set indexed by \a index. | |
381 | If the index is out of bounds 0.0 is returned. |
|
386 | If the index is out of bounds 0.0 is returned. | |
382 | */ |
|
387 | */ | |
383 | qreal QBarSet::operator [](const int index) const |
|
388 | qreal QBarSet::operator [](const int index) const | |
384 | { |
|
389 | { | |
385 | return at(index); |
|
390 | return at(index); | |
386 | } |
|
391 | } | |
387 |
|
392 | |||
388 | /*! |
|
393 | /*! | |
389 | Returns count of values in set. |
|
394 | Returns count of values in set. | |
390 | */ |
|
395 | */ | |
391 | int QBarSet::count() const |
|
396 | int QBarSet::count() const | |
392 | { |
|
397 | { | |
393 | return d_ptr->m_values.count(); |
|
398 | return d_ptr->m_values.count(); | |
394 | } |
|
399 | } | |
395 |
|
400 | |||
396 | /*! |
|
401 | /*! | |
397 | Returns sum of all values in the bar set. |
|
402 | Returns sum of all values in the bar set. | |
398 | */ |
|
403 | */ | |
399 | qreal QBarSet::sum() const |
|
404 | qreal QBarSet::sum() const | |
400 | { |
|
405 | { | |
401 | qreal total(0); |
|
406 | qreal total(0); | |
402 | for (int i = 0; i < d_ptr->m_values.count(); i++) |
|
407 | for (int i = 0; i < d_ptr->m_values.count(); i++) | |
403 | total += d_ptr->m_values.at(i).y(); |
|
408 | total += d_ptr->m_values.at(i).y(); | |
404 | return total; |
|
409 | return total; | |
405 | } |
|
410 | } | |
406 |
|
411 | |||
407 | /*! |
|
412 | /*! | |
408 | Sets pen for set. Bars of this set are drawn using \a pen |
|
413 | Sets pen for set. Bars of this set are drawn using \a pen | |
409 | */ |
|
414 | */ | |
410 | void QBarSet::setPen(const QPen &pen) |
|
415 | void QBarSet::setPen(const QPen &pen) | |
411 | { |
|
416 | { | |
412 | if (d_ptr->m_pen != pen) { |
|
417 | if (d_ptr->m_pen != pen) { | |
413 | d_ptr->m_pen = pen; |
|
418 | d_ptr->m_pen = pen; | |
414 | emit d_ptr->updatedBars(); |
|
419 | emit d_ptr->updatedBars(); | |
415 | emit penChanged(); |
|
420 | emit penChanged(); | |
416 | } |
|
421 | } | |
417 | } |
|
422 | } | |
418 |
|
423 | |||
419 | /*! |
|
424 | /*! | |
420 | Returns pen of the set. |
|
425 | Returns pen of the set. | |
421 | */ |
|
426 | */ | |
422 | QPen QBarSet::pen() const |
|
427 | QPen QBarSet::pen() const | |
423 | { |
|
428 | { | |
424 | if (d_ptr->m_pen == QChartPrivate::defaultPen()) |
|
429 | if (d_ptr->m_pen == QChartPrivate::defaultPen()) | |
425 | return QPen(); |
|
430 | return QPen(); | |
426 | else |
|
431 | else | |
427 | return d_ptr->m_pen; |
|
432 | return d_ptr->m_pen; | |
428 | } |
|
433 | } | |
429 |
|
434 | |||
430 | /*! |
|
435 | /*! | |
431 | Sets brush for the set. Bars of this set are drawn using \a brush. |
|
436 | Sets brush for the set. Bars of this set are drawn using \a brush. | |
432 | */ |
|
437 | */ | |
433 | void QBarSet::setBrush(const QBrush &brush) |
|
438 | void QBarSet::setBrush(const QBrush &brush) | |
434 | { |
|
439 | { | |
435 | if (d_ptr->m_brush != brush) { |
|
440 | if (d_ptr->m_brush != brush) { | |
436 | d_ptr->m_brush = brush; |
|
441 | d_ptr->m_brush = brush; | |
437 | emit d_ptr->updatedBars(); |
|
442 | emit d_ptr->updatedBars(); | |
438 | emit brushChanged(); |
|
443 | emit brushChanged(); | |
439 | } |
|
444 | } | |
440 | } |
|
445 | } | |
441 |
|
446 | |||
442 | /*! |
|
447 | /*! | |
443 | Returns brush of the set. |
|
448 | Returns brush of the set. | |
444 | */ |
|
449 | */ | |
445 | QBrush QBarSet::brush() const |
|
450 | QBrush QBarSet::brush() const | |
446 | { |
|
451 | { | |
447 | if (d_ptr->m_brush == QChartPrivate::defaultBrush()) |
|
452 | if (d_ptr->m_brush == QChartPrivate::defaultBrush()) | |
448 | return QBrush(); |
|
453 | return QBrush(); | |
449 | else |
|
454 | else | |
450 | return d_ptr->m_brush; |
|
455 | return d_ptr->m_brush; | |
451 | } |
|
456 | } | |
452 |
|
457 | |||
453 | /*! |
|
458 | /*! | |
454 | Sets \a brush of the values that are drawn on top of this bar set. |
|
459 | Sets \a brush of the values that are drawn on top of this bar set. | |
455 | */ |
|
460 | */ | |
456 | void QBarSet::setLabelBrush(const QBrush &brush) |
|
461 | void QBarSet::setLabelBrush(const QBrush &brush) | |
457 | { |
|
462 | { | |
458 | if (d_ptr->m_labelBrush != brush) { |
|
463 | if (d_ptr->m_labelBrush != brush) { | |
459 | d_ptr->m_labelBrush = brush; |
|
464 | d_ptr->m_labelBrush = brush; | |
460 | emit d_ptr->updatedBars(); |
|
465 | emit d_ptr->updatedBars(); | |
461 | emit labelBrushChanged(); |
|
466 | emit labelBrushChanged(); | |
462 | } |
|
467 | } | |
463 | } |
|
468 | } | |
464 |
|
469 | |||
465 | /*! |
|
470 | /*! | |
466 | Returns brush of the values that are drawn on top of this bar set. |
|
471 | Returns brush of the values that are drawn on top of this bar set. | |
467 | */ |
|
472 | */ | |
468 | QBrush QBarSet::labelBrush() const |
|
473 | QBrush QBarSet::labelBrush() const | |
469 | { |
|
474 | { | |
470 | if (d_ptr->m_labelBrush == QChartPrivate::defaultBrush()) |
|
475 | if (d_ptr->m_labelBrush == QChartPrivate::defaultBrush()) | |
471 | return QBrush(); |
|
476 | return QBrush(); | |
472 | else |
|
477 | else | |
473 | return d_ptr->m_labelBrush; |
|
478 | return d_ptr->m_labelBrush; | |
474 | } |
|
479 | } | |
475 |
|
480 | |||
476 | /*! |
|
481 | /*! | |
477 | Sets the \a font for values that are drawn on top of this bar set. |
|
482 | Sets the \a font for values that are drawn on top of this bar set. | |
478 | */ |
|
483 | */ | |
479 | void QBarSet::setLabelFont(const QFont &font) |
|
484 | void QBarSet::setLabelFont(const QFont &font) | |
480 | { |
|
485 | { | |
481 | if (d_ptr->m_labelFont != font) { |
|
486 | if (d_ptr->m_labelFont != font) { | |
482 | d_ptr->m_labelFont = font; |
|
487 | d_ptr->m_labelFont = font; | |
483 | emit d_ptr->updatedBars(); |
|
488 | emit d_ptr->updatedBars(); | |
484 | emit labelFontChanged(); |
|
489 | emit labelFontChanged(); | |
485 | } |
|
490 | } | |
486 |
|
491 | |||
487 | } |
|
492 | } | |
488 |
|
493 | |||
489 | /*! |
|
494 | /*! | |
490 | Returns the pen for values that are drawn on top of this bar set. |
|
495 | Returns the pen for values that are drawn on top of this bar set. | |
491 | */ |
|
496 | */ | |
492 | QFont QBarSet::labelFont() const |
|
497 | QFont QBarSet::labelFont() const | |
493 | { |
|
498 | { | |
494 | return d_ptr->m_labelFont; |
|
499 | return d_ptr->m_labelFont; | |
495 | } |
|
500 | } | |
496 |
|
501 | |||
497 | /*! |
|
502 | /*! | |
498 | Returns the color of the brush of bar set. |
|
503 | Returns the color of the brush of bar set. | |
499 | */ |
|
504 | */ | |
500 | QColor QBarSet::color() |
|
505 | QColor QBarSet::color() | |
501 | { |
|
506 | { | |
502 | return brush().color(); |
|
507 | return brush().color(); | |
503 | } |
|
508 | } | |
504 |
|
509 | |||
505 | /*! |
|
510 | /*! | |
506 | Sets the \a color of brush for this bar set. |
|
511 | Sets the \a color of brush for this bar set. | |
507 | */ |
|
512 | */ | |
508 | void QBarSet::setColor(QColor color) |
|
513 | void QBarSet::setColor(QColor color) | |
509 | { |
|
514 | { | |
510 | QBrush b = brush(); |
|
515 | QBrush b = brush(); | |
511 | if ((b.color() != color) || (b.style() == Qt::NoBrush)) { |
|
516 | if ((b.color() != color) || (b.style() == Qt::NoBrush)) { | |
512 | b.setColor(color); |
|
517 | b.setColor(color); | |
513 | if (b.style() == Qt::NoBrush) { |
|
518 | if (b.style() == Qt::NoBrush) { | |
514 | // Set tyle to Qt::SolidPattern. (Default is Qt::NoBrush) |
|
519 | // Set tyle to Qt::SolidPattern. (Default is Qt::NoBrush) | |
515 | // This prevents theme to override color defined in QML side: |
|
520 | // This prevents theme to override color defined in QML side: | |
516 | // BarSet { label: "Bob"; color:"red"; values: [1,2,3] } |
|
521 | // BarSet { label: "Bob"; color:"red"; values: [1,2,3] } | |
517 | // The color must be obeyed, since user wanted it. |
|
522 | // The color must be obeyed, since user wanted it. | |
518 | b.setStyle(Qt::SolidPattern); |
|
523 | b.setStyle(Qt::SolidPattern); | |
519 | } |
|
524 | } | |
520 | setBrush(b); |
|
525 | setBrush(b); | |
521 | emit colorChanged(color); |
|
526 | emit colorChanged(color); | |
522 | } |
|
527 | } | |
523 | } |
|
528 | } | |
524 |
|
529 | |||
525 | /*! |
|
530 | /*! | |
526 | Returns the color of pen of this bar set. |
|
531 | Returns the color of pen of this bar set. | |
527 | */ |
|
532 | */ | |
528 | QColor QBarSet::borderColor() |
|
533 | QColor QBarSet::borderColor() | |
529 | { |
|
534 | { | |
530 | return pen().color(); |
|
535 | return pen().color(); | |
531 | } |
|
536 | } | |
532 |
|
537 | |||
533 | /*! |
|
538 | /*! | |
534 | Sets the color of pen for this bar set. |
|
539 | Sets the color of pen for this bar set. | |
535 | */ |
|
540 | */ | |
536 | void QBarSet::setBorderColor(QColor color) |
|
541 | void QBarSet::setBorderColor(QColor color) | |
537 | { |
|
542 | { | |
538 | QPen p = pen(); |
|
543 | QPen p = pen(); | |
539 | if (p.color() != color) { |
|
544 | if (p.color() != color) { | |
540 | p.setColor(color); |
|
545 | p.setColor(color); | |
541 | setPen(p); |
|
546 | setPen(p); | |
542 | emit borderColorChanged(color); |
|
547 | emit borderColorChanged(color); | |
543 | } |
|
548 | } | |
544 | } |
|
549 | } | |
545 |
|
550 | |||
546 | /*! |
|
551 | /*! | |
547 | Returns the color of labels of this bar set. |
|
552 | Returns the color of labels of this bar set. | |
548 | */ |
|
553 | */ | |
549 | QColor QBarSet::labelColor() |
|
554 | QColor QBarSet::labelColor() | |
550 | { |
|
555 | { | |
551 | return labelBrush().color(); |
|
556 | return labelBrush().color(); | |
552 | } |
|
557 | } | |
553 |
|
558 | |||
554 | /*! |
|
559 | /*! | |
555 | Sets the color of labels for this bar set. |
|
560 | Sets the color of labels for this bar set. | |
556 | */ |
|
561 | */ | |
557 | void QBarSet::setLabelColor(QColor color) |
|
562 | void QBarSet::setLabelColor(QColor color) | |
558 | { |
|
563 | { | |
559 | QBrush b = labelBrush(); |
|
564 | QBrush b = labelBrush(); | |
560 | if (b == QBrush()) |
|
565 | if (b == QBrush()) | |
561 | b.setStyle(Qt::SolidPattern); |
|
566 | b.setStyle(Qt::SolidPattern); | |
562 |
|
567 | |||
563 | if (b.color() != color) { |
|
568 | if (b.color() != color) { | |
564 | b.setColor(color); |
|
569 | b.setColor(color); | |
565 | setLabelBrush(b); |
|
570 | setLabelBrush(b); | |
566 | emit labelColorChanged(color); |
|
571 | emit labelColorChanged(color); | |
567 | } |
|
572 | } | |
568 | } |
|
573 | } | |
569 |
|
574 | |||
570 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
575 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
571 |
|
576 | |||
572 | QBarSetPrivate::QBarSetPrivate(const QString label, QBarSet *parent) : QObject(parent), |
|
577 | QBarSetPrivate::QBarSetPrivate(const QString label, QBarSet *parent) : QObject(parent), | |
573 | q_ptr(parent), |
|
578 | q_ptr(parent), | |
574 | m_label(label), |
|
579 | m_label(label), | |
575 | m_pen(QChartPrivate::defaultPen()), |
|
580 | m_pen(QChartPrivate::defaultPen()), | |
576 | m_brush(QChartPrivate::defaultBrush()), |
|
581 | m_brush(QChartPrivate::defaultBrush()), | |
577 | m_labelBrush(QChartPrivate::defaultBrush()) |
|
582 | m_labelBrush(QChartPrivate::defaultBrush()) | |
578 | { |
|
583 | { | |
579 | } |
|
584 | } | |
580 |
|
585 | |||
581 | QBarSetPrivate::~QBarSetPrivate() |
|
586 | QBarSetPrivate::~QBarSetPrivate() | |
582 | { |
|
587 | { | |
583 | } |
|
588 | } | |
584 |
|
589 | |||
585 | void QBarSetPrivate::append(QPointF value) |
|
590 | void QBarSetPrivate::append(QPointF value) | |
586 | { |
|
591 | { | |
587 | if (isValidValue(value)) { |
|
592 | if (isValidValue(value)) { | |
588 | m_values.append(value); |
|
593 | m_values.append(value); | |
589 | emit restructuredBars(); |
|
594 | emit restructuredBars(); | |
590 | } |
|
595 | } | |
591 | } |
|
596 | } | |
592 |
|
597 | |||
593 | void QBarSetPrivate::append(QList<QPointF> values) |
|
598 | void QBarSetPrivate::append(QList<QPointF> values) | |
594 | { |
|
599 | { | |
595 | for (int i = 0; i < values.count(); i++) { |
|
600 | for (int i = 0; i < values.count(); i++) { | |
596 | if (isValidValue(values.at(i))) |
|
601 | if (isValidValue(values.at(i))) | |
597 | m_values.append(values.at(i)); |
|
602 | m_values.append(values.at(i)); | |
598 | } |
|
603 | } | |
599 | emit restructuredBars(); |
|
604 | emit restructuredBars(); | |
600 | } |
|
605 | } | |
601 |
|
606 | |||
602 | void QBarSetPrivate::append(QList<qreal> values) |
|
607 | void QBarSetPrivate::append(QList<qreal> values) | |
603 | { |
|
608 | { | |
604 | int index = m_values.count(); |
|
609 | int index = m_values.count(); | |
605 | for (int i = 0; i < values.count(); i++) { |
|
610 | for (int i = 0; i < values.count(); i++) { | |
606 | if (isValidValue(values.at(i))) { |
|
611 | if (isValidValue(values.at(i))) { | |
607 | m_values.append(QPointF(index, values.at(i))); |
|
612 | m_values.append(QPointF(index, values.at(i))); | |
608 | index++; |
|
613 | index++; | |
609 | } |
|
614 | } | |
610 | } |
|
615 | } | |
611 | emit restructuredBars(); |
|
616 | emit restructuredBars(); | |
612 | } |
|
617 | } | |
613 |
|
618 | |||
614 | void QBarSetPrivate::insert(const int index, const qreal value) |
|
619 | void QBarSetPrivate::insert(const int index, const qreal value) | |
615 | { |
|
620 | { | |
616 | m_values.insert(index, QPointF(index, value)); |
|
621 | m_values.insert(index, QPointF(index, value)); | |
617 | emit restructuredBars(); |
|
622 | emit restructuredBars(); | |
618 | } |
|
623 | } | |
619 |
|
624 | |||
620 | void QBarSetPrivate::insert(const int index, const QPointF value) |
|
625 | void QBarSetPrivate::insert(const int index, const QPointF value) | |
621 | { |
|
626 | { | |
622 | m_values.insert(index, value); |
|
627 | m_values.insert(index, value); | |
623 | emit restructuredBars(); |
|
628 | emit restructuredBars(); | |
624 | } |
|
629 | } | |
625 |
|
630 | |||
626 | int QBarSetPrivate::remove(const int index, const int count) |
|
631 | int QBarSetPrivate::remove(const int index, const int count) | |
627 | { |
|
632 | { | |
628 | int removeCount = count; |
|
633 | int removeCount = count; | |
629 |
|
634 | |||
630 | if ((index < 0) || (m_values.count() == 0)) |
|
635 | if ((index < 0) || (m_values.count() == 0)) | |
631 | return 0; // Invalid index or not values in list, remove nothing. |
|
636 | return 0; // Invalid index or not values in list, remove nothing. | |
632 | else if ((index + count) > m_values.count()) |
|
637 | else if ((index + count) > m_values.count()) | |
633 | removeCount = m_values.count() - index; // Trying to remove more items than list has. Limit amount to be removed. |
|
638 | removeCount = m_values.count() - index; // Trying to remove more items than list has. Limit amount to be removed. | |
634 |
|
639 | |||
635 | int c = 0; |
|
640 | int c = 0; | |
636 | while (c < removeCount) { |
|
641 | while (c < removeCount) { | |
637 | m_values.removeAt(index); |
|
642 | m_values.removeAt(index); | |
638 | c++; |
|
643 | c++; | |
639 | } |
|
644 | } | |
640 | emit restructuredBars(); |
|
645 | emit restructuredBars(); | |
641 | return removeCount; |
|
646 | return removeCount; | |
642 | } |
|
647 | } | |
643 |
|
648 | |||
644 | void QBarSetPrivate::replace(const int index, const qreal value) |
|
649 | void QBarSetPrivate::replace(const int index, const qreal value) | |
645 | { |
|
650 | { | |
646 | m_values.replace(index, QPointF(index, value)); |
|
651 | m_values.replace(index, QPointF(index, value)); | |
647 | emit updatedLayout(); |
|
652 | emit updatedLayout(); | |
648 | } |
|
653 | } | |
649 |
|
654 | |||
650 | void QBarSetPrivate::replace(const int index, const QPointF value) |
|
655 | void QBarSetPrivate::replace(const int index, const QPointF value) | |
651 | { |
|
656 | { | |
652 | m_values.replace(index, value); |
|
657 | m_values.replace(index, value); | |
653 | emit updatedLayout(); |
|
658 | emit updatedLayout(); | |
654 | } |
|
659 | } | |
655 |
|
660 | |||
656 | qreal QBarSetPrivate::pos(const int index) |
|
661 | qreal QBarSetPrivate::pos(const int index) | |
657 | { |
|
662 | { | |
658 | if (index < 0 || index >= m_values.count()) |
|
663 | if (index < 0 || index >= m_values.count()) | |
659 | return 0; |
|
664 | return 0; | |
660 | return m_values.at(index).x(); |
|
665 | return m_values.at(index).x(); | |
661 | } |
|
666 | } | |
662 |
|
667 | |||
663 | qreal QBarSetPrivate::value(const int index) |
|
668 | qreal QBarSetPrivate::value(const int index) | |
664 | { |
|
669 | { | |
665 | if (index < 0 || index >= m_values.count()) |
|
670 | if (index < 0 || index >= m_values.count()) | |
666 | return 0; |
|
671 | return 0; | |
667 | return m_values.at(index).y(); |
|
672 | return m_values.at(index).y(); | |
668 | } |
|
673 | } | |
669 |
|
674 | |||
670 | #include "moc_qbarset.cpp" |
|
675 | #include "moc_qbarset.cpp" | |
671 | #include "moc_qbarset_p.cpp" |
|
676 | #include "moc_qbarset_p.cpp" | |
672 |
|
677 | |||
673 | QTCOMMERCIALCHART_END_NAMESPACE |
|
678 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,680 +1,686 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qboxplotseries.h" |
|
21 | #include "qboxplotseries.h" | |
22 | #include "qboxplotseries_p.h" |
|
22 | #include "qboxplotseries_p.h" | |
23 | #include "qboxplotlegendmarker.h" |
|
23 | #include "qboxplotlegendmarker.h" | |
24 | #include "qbarcategoryaxis.h" |
|
24 | #include "qbarcategoryaxis.h" | |
25 | #include "boxplotchartitem_p.h" |
|
25 | #include "boxplotchartitem_p.h" | |
26 | #include "chartdataset_p.h" |
|
26 | #include "chartdataset_p.h" | |
27 | #include "charttheme_p.h" |
|
27 | #include "charttheme_p.h" | |
28 | #include "qvalueaxis.h" |
|
28 | #include "qvalueaxis.h" | |
29 | #include "charttheme_p.h" |
|
29 | #include "charttheme_p.h" | |
30 | #include "boxplotanimation_p.h" |
|
30 | #include "boxplotanimation_p.h" | |
31 | #include "qchart_p.h" |
|
31 | #include "qchart_p.h" | |
32 | #include "qboxset.h" |
|
32 | #include "qboxset.h" | |
33 | #include "qboxset_p.h" |
|
33 | #include "qboxset_p.h" | |
34 |
|
34 | |||
35 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
35 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
36 |
|
36 | |||
37 | /*! |
|
37 | /*! | |
38 | \class QBoxPlotSeries |
|
38 | \class QBoxPlotSeries | |
39 | \inmodule Qt Charts |
|
39 | \inmodule Qt Charts | |
40 | \brief Series for creating box-and-whiskers chart |
|
40 | \brief Series for creating box-and-whiskers chart | |
41 | \mainclass |
|
41 | \mainclass | |
42 |
|
42 | |||
43 | QBoxPlotSeries represents a series of data shown as box-and-whisker bars. The purpose of this class is to act as |
|
43 | QBoxPlotSeries represents a series of data shown as box-and-whisker bars. The purpose of this class is to act as | |
44 | a container for single box-and-whisker items. Each item is drawn to own slot. If chart includes multiple instances of |
|
44 | a container for single box-and-whisker items. Each item is drawn to own slot. If chart includes multiple instances of | |
45 | QBoxPlotSeries then box-and-whiskers items with the same index are drawn to same slot. |
|
45 | QBoxPlotSeries then box-and-whiskers items with the same index are drawn to same slot. | |
46 |
|
46 | |||
47 | See the \l {Box and Whiskers Example} {box-and-whiskers chart example} to learn how to create a box-and-whiskers chart. |
|
47 | See the \l {Box and Whiskers Example} {box-and-whiskers chart example} to learn how to create a box-and-whiskers chart. | |
48 | \image examples_boxplotchart.png |
|
48 | \image examples_boxplotchart.png | |
49 |
|
49 | |||
50 | \sa QBoxSet |
|
50 | \sa QBoxSet | |
51 | */ |
|
51 | */ | |
52 | /*! |
|
52 | /*! | |
53 | \fn QBoxPlotSeries::boxsetsAdded(QList<QBoxSet *> sets) |
|
53 | \fn QBoxPlotSeries::boxsetsAdded(QList<QBoxSet *> sets) | |
54 | \brief Signal is emitted when a new \a sets of box-and-whiskers data is added to the series. |
|
54 | \brief Signal is emitted when a new \a sets of box-and-whiskers data is added to the series. | |
55 | */ |
|
55 | */ | |
56 | /*! |
|
56 | /*! | |
57 | \fn QBoxPlotSeries::boxsetsRemoved(QList<QBoxSet *> sets) |
|
57 | \fn QBoxPlotSeries::boxsetsRemoved(QList<QBoxSet *> sets) | |
58 | \brief Signal is emitted when \a sets of box-and-whiskers data is removed from the series. |
|
58 | \brief Signal is emitted when \a sets of box-and-whiskers data is removed from the series. | |
59 | */ |
|
59 | */ | |
60 | /*! |
|
60 | /*! | |
61 | \fn QBoxPlotSeries::clicked(QBoxSet *boxset) |
|
61 | \fn QBoxPlotSeries::clicked(QBoxSet *boxset) | |
62 | \brief Signal is emitted when the user clicks the \a boxset on the chart. |
|
62 | \brief Signal is emitted when the user clicks the \a boxset on the chart. | |
63 | */ |
|
63 | */ | |
64 | /*! |
|
64 | /*! | |
65 | \fn QBoxPlotSeries::hovered(bool status, QBoxSet *boxset) |
|
65 | \fn QBoxPlotSeries::hovered(bool status, QBoxSet *boxset) | |
66 | \brief Signal is emitted when there is change in hover \a status over \a boxset. |
|
66 | \brief Signal is emitted when there is change in hover \a status over \a boxset. | |
67 | */ |
|
67 | */ | |
68 | /*! |
|
68 | /*! | |
69 | \fn QBoxPlotSeries::countChanged() |
|
69 | \fn QBoxPlotSeries::countChanged() | |
70 | \brief Signal is emitted when there is change in count of box-and-whiskers items in the series. |
|
70 | \brief Signal is emitted when there is change in count of box-and-whiskers items in the series. | |
71 | */ |
|
71 | */ | |
72 | /*! |
|
72 | /*! | |
73 | \property QBoxPlotSeries::boxOutlineVisible |
|
73 | \property QBoxPlotSeries::boxOutlineVisible | |
74 | \brief This property configures the visibility of the middle box outline. |
|
74 | \brief This property configures the visibility of the middle box outline. | |
75 | */ |
|
75 | */ | |
76 | /*! |
|
76 | /*! | |
77 | \property QBoxPlotSeries::boxWidth |
|
77 | \property QBoxPlotSeries::boxWidth | |
78 | \brief This property configures the width of the box-and-whiskers item. The value signifies the relative |
|
78 | \brief This property configures the width of the box-and-whiskers item. The value signifies the relative | |
79 | width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values |
|
79 | width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values | |
80 | are clamped to 0.0 and values over 1.0 are clamped to 1.0. |
|
80 | are clamped to 0.0 and values over 1.0 are clamped to 1.0. | |
81 | */ |
|
81 | */ | |
82 | /*! |
|
82 | /*! | |
83 | \property QBoxPlotSeries::pen |
|
83 | \property QBoxPlotSeries::pen | |
84 | \brief This property configures the pen of the box-and-whiskers items. |
|
84 | \brief This property configures the pen of the box-and-whiskers items. | |
85 | */ |
|
85 | */ | |
86 | /*! |
|
86 | /*! | |
87 | \property QBoxPlotSeries::brush |
|
87 | \property QBoxPlotSeries::brush | |
88 | \brief This property configures the brush of the box-and-whiskers items. |
|
88 | \brief This property configures the brush of the box-and-whiskers items. | |
89 | */ |
|
89 | */ | |
|
90 | ||||
|
91 | /*! | |||
|
92 | \qmlproperty QString BoxPlotSeries::brushFilename | |||
|
93 | The name of the file used as a brush for the series. | |||
|
94 | */ | |||
|
95 | ||||
90 | /*! |
|
96 | /*! | |
91 | \fn void QBoxPlotSeries::boxOutlineVisibilityChanged() |
|
97 | \fn void QBoxPlotSeries::boxOutlineVisibilityChanged() | |
92 | Signal is emitted when the middle box outline visibility is changed. |
|
98 | Signal is emitted when the middle box outline visibility is changed. | |
93 | */ |
|
99 | */ | |
94 | /*! |
|
100 | /*! | |
95 | \fn void QBoxPlotSeries::boxWidthChanged() |
|
101 | \fn void QBoxPlotSeries::boxWidthChanged() | |
96 | Signal is emitted when the width of the box-and-whiskers item is changed. |
|
102 | Signal is emitted when the width of the box-and-whiskers item is changed. | |
97 | */ |
|
103 | */ | |
98 | /*! |
|
104 | /*! | |
99 | \fn void QBoxPlotSeries::penChanged() |
|
105 | \fn void QBoxPlotSeries::penChanged() | |
100 | This signal is emitted when the pen of the box-and-whiskers has changed. |
|
106 | This signal is emitted when the pen of the box-and-whiskers has changed. | |
101 | \sa brush |
|
107 | \sa brush | |
102 | */ |
|
108 | */ | |
103 | /*! |
|
109 | /*! | |
104 | \fn void QBoxPlotSeries::brushChanged() |
|
110 | \fn void QBoxPlotSeries::brushChanged() | |
105 | This signal is emitted when the brush of the box-and-whiskers has changed. |
|
111 | This signal is emitted when the brush of the box-and-whiskers has changed. | |
106 | \sa brush |
|
112 | \sa brush | |
107 | */ |
|
113 | */ | |
108 | /*! |
|
114 | /*! | |
109 | \fn virtual SeriesType QBoxPlotSeries::type() const |
|
115 | \fn virtual SeriesType QBoxPlotSeries::type() const | |
110 | \brief Returns type of series. |
|
116 | \brief Returns type of series. | |
111 | \sa QAbstractSeries, SeriesType |
|
117 | \sa QAbstractSeries, SeriesType | |
112 | */ |
|
118 | */ | |
113 |
|
119 | |||
114 | /*! |
|
120 | /*! | |
115 | Constructs empty QBoxPlotSeries. |
|
121 | Constructs empty QBoxPlotSeries. | |
116 | QBoxPlotSeries is QObject which is a child of a \a parent. |
|
122 | QBoxPlotSeries is QObject which is a child of a \a parent. | |
117 | */ |
|
123 | */ | |
118 | QBoxPlotSeries::QBoxPlotSeries(QObject *parent) |
|
124 | QBoxPlotSeries::QBoxPlotSeries(QObject *parent) | |
119 | : QAbstractSeries(*new QBoxPlotSeriesPrivate(this), parent) |
|
125 | : QAbstractSeries(*new QBoxPlotSeriesPrivate(this), parent) | |
120 | { |
|
126 | { | |
121 | } |
|
127 | } | |
122 |
|
128 | |||
123 | /*! |
|
129 | /*! | |
124 | Destructor. Removes series from chart. |
|
130 | Destructor. Removes series from chart. | |
125 | */ |
|
131 | */ | |
126 | QBoxPlotSeries::~QBoxPlotSeries() |
|
132 | QBoxPlotSeries::~QBoxPlotSeries() | |
127 | { |
|
133 | { | |
128 | Q_D(QBoxPlotSeries); |
|
134 | Q_D(QBoxPlotSeries); | |
129 | if (d->m_chart) |
|
135 | if (d->m_chart) | |
130 | d->m_chart->removeSeries(this); |
|
136 | d->m_chart->removeSeries(this); | |
131 | } |
|
137 | } | |
132 |
|
138 | |||
133 | /*! |
|
139 | /*! | |
134 | Adds a single box and whiskers set to series. Takes ownership of the \a set. If the set is null or is already in series, it won't be appended. |
|
140 | Adds a single box and whiskers set to series. Takes ownership of the \a set. If the set is null or is already in series, it won't be appended. | |
135 | Returns true, if appending succeeded. |
|
141 | Returns true, if appending succeeded. | |
136 | */ |
|
142 | */ | |
137 | bool QBoxPlotSeries::append(QBoxSet *set) |
|
143 | bool QBoxPlotSeries::append(QBoxSet *set) | |
138 | { |
|
144 | { | |
139 | Q_D(QBoxPlotSeries); |
|
145 | Q_D(QBoxPlotSeries); | |
140 |
|
146 | |||
141 | bool success = d->append(set); |
|
147 | bool success = d->append(set); | |
142 | if (success) { |
|
148 | if (success) { | |
143 | QList<QBoxSet *> sets; |
|
149 | QList<QBoxSet *> sets; | |
144 | sets.append(set); |
|
150 | sets.append(set); | |
145 | set->setParent(this); |
|
151 | set->setParent(this); | |
146 | emit boxsetsAdded(sets); |
|
152 | emit boxsetsAdded(sets); | |
147 | emit countChanged(); |
|
153 | emit countChanged(); | |
148 | } |
|
154 | } | |
149 | return success; |
|
155 | return success; | |
150 | } |
|
156 | } | |
151 |
|
157 | |||
152 | /*! |
|
158 | /*! | |
153 | Removes boxset from the series. Deletes the \a set and returns true if successful. |
|
159 | Removes boxset from the series. Deletes the \a set and returns true if successful. | |
154 | */ |
|
160 | */ | |
155 | bool QBoxPlotSeries::remove(QBoxSet *set) |
|
161 | bool QBoxPlotSeries::remove(QBoxSet *set) | |
156 | { |
|
162 | { | |
157 | Q_D(QBoxPlotSeries); |
|
163 | Q_D(QBoxPlotSeries); | |
158 | bool success = d->remove(set); |
|
164 | bool success = d->remove(set); | |
159 | if (success) { |
|
165 | if (success) { | |
160 | QList<QBoxSet *> sets; |
|
166 | QList<QBoxSet *> sets; | |
161 | sets.append(set); |
|
167 | sets.append(set); | |
162 | set->setParent(0); |
|
168 | set->setParent(0); | |
163 | emit boxsetsRemoved(sets); |
|
169 | emit boxsetsRemoved(sets); | |
164 | emit countChanged(); |
|
170 | emit countChanged(); | |
165 | delete set; |
|
171 | delete set; | |
166 | set = 0; |
|
172 | set = 0; | |
167 | } |
|
173 | } | |
168 | return success; |
|
174 | return success; | |
169 | } |
|
175 | } | |
170 |
|
176 | |||
171 | /*! |
|
177 | /*! | |
172 | Takes a single \a set from the series. Does not delete the boxset object. |
|
178 | Takes a single \a set from the series. Does not delete the boxset object. | |
173 |
|
179 | |||
174 | NOTE: The series remains as the boxset's parent object. You must set the |
|
180 | NOTE: The series remains as the boxset's parent object. You must set the | |
175 | parent object to take full ownership. |
|
181 | parent object to take full ownership. | |
176 |
|
182 | |||
177 | Returns true if take was successful. |
|
183 | Returns true if take was successful. | |
178 | */ |
|
184 | */ | |
179 | bool QBoxPlotSeries::take(QBoxSet *set) |
|
185 | bool QBoxPlotSeries::take(QBoxSet *set) | |
180 | { |
|
186 | { | |
181 | Q_D(QBoxPlotSeries); |
|
187 | Q_D(QBoxPlotSeries); | |
182 |
|
188 | |||
183 | bool success = d->remove(set); |
|
189 | bool success = d->remove(set); | |
184 | if (success) { |
|
190 | if (success) { | |
185 | QList<QBoxSet *> sets; |
|
191 | QList<QBoxSet *> sets; | |
186 | sets.append(set); |
|
192 | sets.append(set); | |
187 | emit boxsetsRemoved(sets); |
|
193 | emit boxsetsRemoved(sets); | |
188 | emit countChanged(); |
|
194 | emit countChanged(); | |
189 | } |
|
195 | } | |
190 | return success; |
|
196 | return success; | |
191 | } |
|
197 | } | |
192 |
|
198 | |||
193 | /*! |
|
199 | /*! | |
194 | Adds a list of boxsets to series. Takes ownership of the \a sets. |
|
200 | Adds a list of boxsets to series. Takes ownership of the \a sets. | |
195 | Returns true, if all sets were appended successfully. If any of the sets is null or is already appended to series, |
|
201 | Returns true, if all sets were appended successfully. If any of the sets is null or is already appended to series, | |
196 | nothing is appended and function returns false. If any of the sets is in list more than once, nothing is appended |
|
202 | nothing is appended and function returns false. If any of the sets is in list more than once, nothing is appended | |
197 | and function returns false. |
|
203 | and function returns false. | |
198 | */ |
|
204 | */ | |
199 | bool QBoxPlotSeries::append(QList<QBoxSet *> sets) |
|
205 | bool QBoxPlotSeries::append(QList<QBoxSet *> sets) | |
200 | { |
|
206 | { | |
201 | Q_D(QBoxPlotSeries); |
|
207 | Q_D(QBoxPlotSeries); | |
202 | bool success = d->append(sets); |
|
208 | bool success = d->append(sets); | |
203 | if (success) { |
|
209 | if (success) { | |
204 | emit boxsetsAdded(sets); |
|
210 | emit boxsetsAdded(sets); | |
205 | emit countChanged(); |
|
211 | emit countChanged(); | |
206 | } |
|
212 | } | |
207 | return success; |
|
213 | return success; | |
208 | } |
|
214 | } | |
209 |
|
215 | |||
210 | /*! |
|
216 | /*! | |
211 | Insert a box-and-whiskers set to the series at \a index postion. Takes ownership of the \a set. If the set is null or |
|
217 | Insert a box-and-whiskers set to the series at \a index postion. Takes ownership of the \a set. If the set is null or | |
212 | is already in series, it won't be appended. Returns true, if inserting succeeded. |
|
218 | is already in series, it won't be appended. Returns true, if inserting succeeded. | |
213 |
|
219 | |||
214 | */ |
|
220 | */ | |
215 | bool QBoxPlotSeries::insert(int index, QBoxSet *set) |
|
221 | bool QBoxPlotSeries::insert(int index, QBoxSet *set) | |
216 | { |
|
222 | { | |
217 | Q_D(QBoxPlotSeries); |
|
223 | Q_D(QBoxPlotSeries); | |
218 | bool success = d->insert(index, set); |
|
224 | bool success = d->insert(index, set); | |
219 | if (success) { |
|
225 | if (success) { | |
220 | QList<QBoxSet *> sets; |
|
226 | QList<QBoxSet *> sets; | |
221 | sets.append(set); |
|
227 | sets.append(set); | |
222 | emit boxsetsAdded(sets); |
|
228 | emit boxsetsAdded(sets); | |
223 | emit countChanged(); |
|
229 | emit countChanged(); | |
224 | } |
|
230 | } | |
225 | return success; |
|
231 | return success; | |
226 | } |
|
232 | } | |
227 |
|
233 | |||
228 | /*! |
|
234 | /*! | |
229 | Removes all boxsets from the series. Deletes removed sets. |
|
235 | Removes all boxsets from the series. Deletes removed sets. | |
230 | */ |
|
236 | */ | |
231 | void QBoxPlotSeries::clear() |
|
237 | void QBoxPlotSeries::clear() | |
232 | { |
|
238 | { | |
233 | Q_D(QBoxPlotSeries); |
|
239 | Q_D(QBoxPlotSeries); | |
234 | QList<QBoxSet *> sets = boxSets(); |
|
240 | QList<QBoxSet *> sets = boxSets(); | |
235 | bool success = d->remove(sets); |
|
241 | bool success = d->remove(sets); | |
236 | if (success) { |
|
242 | if (success) { | |
237 | emit boxsetsRemoved(sets); |
|
243 | emit boxsetsRemoved(sets); | |
238 | emit countChanged(); |
|
244 | emit countChanged(); | |
239 | foreach (QBoxSet *set, sets) |
|
245 | foreach (QBoxSet *set, sets) | |
240 | delete set; |
|
246 | delete set; | |
241 | } |
|
247 | } | |
242 | } |
|
248 | } | |
243 |
|
249 | |||
244 | /*! |
|
250 | /*! | |
245 | Returns number of sets in series. |
|
251 | Returns number of sets in series. | |
246 | */ |
|
252 | */ | |
247 | int QBoxPlotSeries::count() const |
|
253 | int QBoxPlotSeries::count() const | |
248 | { |
|
254 | { | |
249 | Q_D(const QBoxPlotSeries); |
|
255 | Q_D(const QBoxPlotSeries); | |
250 | return d->m_boxSets.count(); |
|
256 | return d->m_boxSets.count(); | |
251 | } |
|
257 | } | |
252 |
|
258 | |||
253 | /*! |
|
259 | /*! | |
254 | Returns a list of sets in series. Keeps ownership of sets. |
|
260 | Returns a list of sets in series. Keeps ownership of sets. | |
255 | */ |
|
261 | */ | |
256 | QList<QBoxSet *> QBoxPlotSeries::boxSets() const |
|
262 | QList<QBoxSet *> QBoxPlotSeries::boxSets() const | |
257 | { |
|
263 | { | |
258 | Q_D(const QBoxPlotSeries); |
|
264 | Q_D(const QBoxPlotSeries); | |
259 | return d->m_boxSets; |
|
265 | return d->m_boxSets; | |
260 | } |
|
266 | } | |
261 |
|
267 | |||
262 | /* |
|
268 | /* | |
263 | Returns QAbstractSeries::SeriesTypeBoxPlot. |
|
269 | Returns QAbstractSeries::SeriesTypeBoxPlot. | |
264 | */ |
|
270 | */ | |
265 | QAbstractSeries::SeriesType QBoxPlotSeries::type() const |
|
271 | QAbstractSeries::SeriesType QBoxPlotSeries::type() const | |
266 | { |
|
272 | { | |
267 | return QAbstractSeries::SeriesTypeBoxPlot; |
|
273 | return QAbstractSeries::SeriesTypeBoxPlot; | |
268 | } |
|
274 | } | |
269 |
|
275 | |||
270 | void QBoxPlotSeries::setBoxOutlineVisible(bool visible) |
|
276 | void QBoxPlotSeries::setBoxOutlineVisible(bool visible) | |
271 | { |
|
277 | { | |
272 | Q_D(QBoxPlotSeries); |
|
278 | Q_D(QBoxPlotSeries); | |
273 |
|
279 | |||
274 | if (d->m_boxOutlineVisible != visible) { |
|
280 | if (d->m_boxOutlineVisible != visible) { | |
275 | d->m_boxOutlineVisible = visible; |
|
281 | d->m_boxOutlineVisible = visible; | |
276 | emit d->updated(); |
|
282 | emit d->updated(); | |
277 | emit boxOutlineVisibilityChanged(); |
|
283 | emit boxOutlineVisibilityChanged(); | |
278 | } |
|
284 | } | |
279 | } |
|
285 | } | |
280 |
|
286 | |||
281 | bool QBoxPlotSeries::boxOutlineVisible() |
|
287 | bool QBoxPlotSeries::boxOutlineVisible() | |
282 | { |
|
288 | { | |
283 | Q_D(QBoxPlotSeries); |
|
289 | Q_D(QBoxPlotSeries); | |
284 |
|
290 | |||
285 | return d->m_boxOutlineVisible; |
|
291 | return d->m_boxOutlineVisible; | |
286 | } |
|
292 | } | |
287 |
|
293 | |||
288 | void QBoxPlotSeries::setBoxWidth(qreal width) |
|
294 | void QBoxPlotSeries::setBoxWidth(qreal width) | |
289 | { |
|
295 | { | |
290 | Q_D(QBoxPlotSeries); |
|
296 | Q_D(QBoxPlotSeries); | |
291 |
|
297 | |||
292 | if (width != d->m_boxWidth) { |
|
298 | if (width != d->m_boxWidth) { | |
293 | if (width < 0.0) |
|
299 | if (width < 0.0) | |
294 | width = 0.0; |
|
300 | width = 0.0; | |
295 | if (width > 1.0) |
|
301 | if (width > 1.0) | |
296 | width = 1.0; |
|
302 | width = 1.0; | |
297 | d->m_boxWidth = width; |
|
303 | d->m_boxWidth = width; | |
298 | emit d->updatedLayout(); |
|
304 | emit d->updatedLayout(); | |
299 | emit boxWidthChanged(); |
|
305 | emit boxWidthChanged(); | |
300 | } |
|
306 | } | |
301 | } |
|
307 | } | |
302 |
|
308 | |||
303 | qreal QBoxPlotSeries::boxWidth() |
|
309 | qreal QBoxPlotSeries::boxWidth() | |
304 | { |
|
310 | { | |
305 | Q_D(QBoxPlotSeries); |
|
311 | Q_D(QBoxPlotSeries); | |
306 |
|
312 | |||
307 | return d->m_boxWidth; |
|
313 | return d->m_boxWidth; | |
308 | } |
|
314 | } | |
309 |
|
315 | |||
310 | void QBoxPlotSeries::setBrush(const QBrush &brush) |
|
316 | void QBoxPlotSeries::setBrush(const QBrush &brush) | |
311 | { |
|
317 | { | |
312 | Q_D(QBoxPlotSeries); |
|
318 | Q_D(QBoxPlotSeries); | |
313 |
|
319 | |||
314 | if (d->m_brush != brush) { |
|
320 | if (d->m_brush != brush) { | |
315 | d->m_brush = brush; |
|
321 | d->m_brush = brush; | |
316 | emit d->updated(); |
|
322 | emit d->updated(); | |
317 | emit brushChanged(); |
|
323 | emit brushChanged(); | |
318 | } |
|
324 | } | |
319 | } |
|
325 | } | |
320 |
|
326 | |||
321 | QBrush QBoxPlotSeries::brush() const |
|
327 | QBrush QBoxPlotSeries::brush() const | |
322 | { |
|
328 | { | |
323 | Q_D(const QBoxPlotSeries); |
|
329 | Q_D(const QBoxPlotSeries); | |
324 |
|
330 | |||
325 | return d->m_brush; |
|
331 | return d->m_brush; | |
326 | } |
|
332 | } | |
327 |
|
333 | |||
328 | void QBoxPlotSeries::setPen(const QPen &pen) |
|
334 | void QBoxPlotSeries::setPen(const QPen &pen) | |
329 | { |
|
335 | { | |
330 | Q_D(QBoxPlotSeries); |
|
336 | Q_D(QBoxPlotSeries); | |
331 |
|
337 | |||
332 | if (d->m_pen != pen) { |
|
338 | if (d->m_pen != pen) { | |
333 | d->m_pen = pen; |
|
339 | d->m_pen = pen; | |
334 | emit d->updated(); |
|
340 | emit d->updated(); | |
335 | emit penChanged(); |
|
341 | emit penChanged(); | |
336 | } |
|
342 | } | |
337 | } |
|
343 | } | |
338 |
|
344 | |||
339 | QPen QBoxPlotSeries::pen() const |
|
345 | QPen QBoxPlotSeries::pen() const | |
340 | { |
|
346 | { | |
341 | Q_D(const QBoxPlotSeries); |
|
347 | Q_D(const QBoxPlotSeries); | |
342 |
|
348 | |||
343 | return d->m_pen; |
|
349 | return d->m_pen; | |
344 | } |
|
350 | } | |
345 |
|
351 | |||
346 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
352 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
347 |
|
353 | |||
348 | QBoxPlotSeriesPrivate::QBoxPlotSeriesPrivate(QBoxPlotSeries *q) |
|
354 | QBoxPlotSeriesPrivate::QBoxPlotSeriesPrivate(QBoxPlotSeries *q) | |
349 | : QAbstractSeriesPrivate(q), |
|
355 | : QAbstractSeriesPrivate(q), | |
350 | m_pen(QChartPrivate::defaultPen()), |
|
356 | m_pen(QChartPrivate::defaultPen()), | |
351 | m_brush(QChartPrivate::defaultBrush()), |
|
357 | m_brush(QChartPrivate::defaultBrush()), | |
352 | m_boxOutlineVisible(true), |
|
358 | m_boxOutlineVisible(true), | |
353 | m_boxWidth(0.5) |
|
359 | m_boxWidth(0.5) | |
354 | { |
|
360 | { | |
355 | } |
|
361 | } | |
356 |
|
362 | |||
357 | QBoxPlotSeriesPrivate::~QBoxPlotSeriesPrivate() |
|
363 | QBoxPlotSeriesPrivate::~QBoxPlotSeriesPrivate() | |
358 | { |
|
364 | { | |
359 | disconnect(this, 0, 0, 0); |
|
365 | disconnect(this, 0, 0, 0); | |
360 | } |
|
366 | } | |
361 |
|
367 | |||
362 | void QBoxPlotSeriesPrivate::initializeDomain() |
|
368 | void QBoxPlotSeriesPrivate::initializeDomain() | |
363 | { |
|
369 | { | |
364 | qreal minX(domain()->minX()); |
|
370 | qreal minX(domain()->minX()); | |
365 | qreal minY(domain()->minY()); |
|
371 | qreal minY(domain()->minY()); | |
366 | qreal maxX(domain()->maxX()); |
|
372 | qreal maxX(domain()->maxX()); | |
367 | qreal maxY(domain()->maxY()); |
|
373 | qreal maxY(domain()->maxY()); | |
368 |
|
374 | |||
369 | qreal x = m_boxSets.count(); |
|
375 | qreal x = m_boxSets.count(); | |
370 | minX = qMin(minX, qreal(-0.5)); |
|
376 | minX = qMin(minX, qreal(-0.5)); | |
371 | minY = qMin(minY, min()); |
|
377 | minY = qMin(minY, min()); | |
372 | maxX = qMax(maxX, x - qreal(0.5)); |
|
378 | maxX = qMax(maxX, x - qreal(0.5)); | |
373 | maxY = qMax(maxY, max()); |
|
379 | maxY = qMax(maxY, max()); | |
374 |
|
380 | |||
375 | domain()->setRange(minX, maxX, minY, maxY); |
|
381 | domain()->setRange(minX, maxX, minY, maxY); | |
376 | } |
|
382 | } | |
377 |
|
383 | |||
378 | void QBoxPlotSeriesPrivate::initializeAxes() |
|
384 | void QBoxPlotSeriesPrivate::initializeAxes() | |
379 | { |
|
385 | { | |
380 | foreach (QAbstractAxis* axis, m_axes) { |
|
386 | foreach (QAbstractAxis* axis, m_axes) { | |
381 | if (axis->type() == QAbstractAxis::AxisTypeBarCategory) { |
|
387 | if (axis->type() == QAbstractAxis::AxisTypeBarCategory) { | |
382 | if (axis->orientation() == Qt::Horizontal) |
|
388 | if (axis->orientation() == Qt::Horizontal) | |
383 | populateCategories(qobject_cast<QBarCategoryAxis *>(axis)); |
|
389 | populateCategories(qobject_cast<QBarCategoryAxis *>(axis)); | |
384 | } |
|
390 | } | |
385 | } |
|
391 | } | |
386 | } |
|
392 | } | |
387 |
|
393 | |||
388 | QAbstractAxis::AxisType QBoxPlotSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const |
|
394 | QAbstractAxis::AxisType QBoxPlotSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const | |
389 | { |
|
395 | { | |
390 | if (orientation == Qt::Horizontal) |
|
396 | if (orientation == Qt::Horizontal) | |
391 | return QAbstractAxis::AxisTypeBarCategory; |
|
397 | return QAbstractAxis::AxisTypeBarCategory; | |
392 |
|
398 | |||
393 | return QAbstractAxis::AxisTypeValue; |
|
399 | return QAbstractAxis::AxisTypeValue; | |
394 | } |
|
400 | } | |
395 |
|
401 | |||
396 | QAbstractAxis* QBoxPlotSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const |
|
402 | QAbstractAxis* QBoxPlotSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const | |
397 | { |
|
403 | { | |
398 | if (defaultAxisType(orientation) == QAbstractAxis::AxisTypeBarCategory) |
|
404 | if (defaultAxisType(orientation) == QAbstractAxis::AxisTypeBarCategory) | |
399 | return new QBarCategoryAxis; |
|
405 | return new QBarCategoryAxis; | |
400 | else |
|
406 | else | |
401 | return new QValueAxis; |
|
407 | return new QValueAxis; | |
402 | } |
|
408 | } | |
403 |
|
409 | |||
404 | void QBoxPlotSeriesPrivate::populateCategories(QBarCategoryAxis *axis) |
|
410 | void QBoxPlotSeriesPrivate::populateCategories(QBarCategoryAxis *axis) | |
405 | { |
|
411 | { | |
406 | QStringList categories; |
|
412 | QStringList categories; | |
407 | if (axis->categories().isEmpty()) { |
|
413 | if (axis->categories().isEmpty()) { | |
408 | for (int i(1); i < m_boxSets.count() + 1; i++) { |
|
414 | for (int i(1); i < m_boxSets.count() + 1; i++) { | |
409 | QBoxSet *set = m_boxSets.at(i - 1); |
|
415 | QBoxSet *set = m_boxSets.at(i - 1); | |
410 | if (set->label().isEmpty()) |
|
416 | if (set->label().isEmpty()) | |
411 | categories << QString::number(i); |
|
417 | categories << QString::number(i); | |
412 | else |
|
418 | else | |
413 | categories << set->label(); |
|
419 | categories << set->label(); | |
414 | } |
|
420 | } | |
415 | axis->append(categories); |
|
421 | axis->append(categories); | |
416 | } |
|
422 | } | |
417 | } |
|
423 | } | |
418 |
|
424 | |||
419 | void QBoxPlotSeriesPrivate::initializeGraphics(QGraphicsItem *parent) |
|
425 | void QBoxPlotSeriesPrivate::initializeGraphics(QGraphicsItem *parent) | |
420 | { |
|
426 | { | |
421 | Q_Q(QBoxPlotSeries); |
|
427 | Q_Q(QBoxPlotSeries); | |
422 |
|
428 | |||
423 | BoxPlotChartItem *boxPlot = new BoxPlotChartItem(q, parent); |
|
429 | BoxPlotChartItem *boxPlot = new BoxPlotChartItem(q, parent); | |
424 | m_item.reset(boxPlot); |
|
430 | m_item.reset(boxPlot); | |
425 | QAbstractSeriesPrivate::initializeGraphics(parent); |
|
431 | QAbstractSeriesPrivate::initializeGraphics(parent); | |
426 |
|
432 | |||
427 | if (m_chart) { |
|
433 | if (m_chart) { | |
428 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), this, SLOT(handleSeriesChange(QAbstractSeries*)) ); |
|
434 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), this, SLOT(handleSeriesChange(QAbstractSeries*)) ); | |
429 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), this, SLOT(handleSeriesRemove(QAbstractSeries*)) ); |
|
435 | connect(m_chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), this, SLOT(handleSeriesRemove(QAbstractSeries*)) ); | |
430 |
|
436 | |||
431 | QList<QAbstractSeries *> serieses = m_chart->series(); |
|
437 | QList<QAbstractSeries *> serieses = m_chart->series(); | |
432 |
|
438 | |||
433 | // Tries to find this series from the Chart's list of series and deduce the index |
|
439 | // Tries to find this series from the Chart's list of series and deduce the index | |
434 | int index = 0; |
|
440 | int index = 0; | |
435 | foreach (QAbstractSeries *s, serieses) { |
|
441 | foreach (QAbstractSeries *s, serieses) { | |
436 | if (s->type() == QAbstractSeries::SeriesTypeBoxPlot) { |
|
442 | if (s->type() == QAbstractSeries::SeriesTypeBoxPlot) { | |
437 | if (q == static_cast<QBoxPlotSeries *>(s)) { |
|
443 | if (q == static_cast<QBoxPlotSeries *>(s)) { | |
438 | boxPlot->m_seriesIndex = index; |
|
444 | boxPlot->m_seriesIndex = index; | |
439 | m_index = index; |
|
445 | m_index = index; | |
440 | } |
|
446 | } | |
441 | index++; |
|
447 | index++; | |
442 | } |
|
448 | } | |
443 | } |
|
449 | } | |
444 | boxPlot->m_seriesCount = index; |
|
450 | boxPlot->m_seriesCount = index; | |
445 | } |
|
451 | } | |
446 |
|
452 | |||
447 | // Make BoxPlotChartItem to instantiate box & whisker items |
|
453 | // Make BoxPlotChartItem to instantiate box & whisker items | |
448 | boxPlot->handleDataStructureChanged(); |
|
454 | boxPlot->handleDataStructureChanged(); | |
449 | } |
|
455 | } | |
450 |
|
456 | |||
451 | void QBoxPlotSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) |
|
457 | void QBoxPlotSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) | |
452 | { |
|
458 | { | |
453 | Q_Q(QBoxPlotSeries); |
|
459 | Q_Q(QBoxPlotSeries); | |
454 |
|
460 | |||
455 | const QList<QGradient> gradients = theme->seriesGradients(); |
|
461 | const QList<QGradient> gradients = theme->seriesGradients(); | |
456 |
|
462 | |||
457 | if (forced || QChartPrivate::defaultBrush() == m_brush) { |
|
463 | if (forced || QChartPrivate::defaultBrush() == m_brush) { | |
458 | QColor brushColor = ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.5); |
|
464 | QColor brushColor = ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.5); | |
459 | q->setBrush(brushColor); |
|
465 | q->setBrush(brushColor); | |
460 | } |
|
466 | } | |
461 |
|
467 | |||
462 | if (forced || QChartPrivate::defaultPen() == m_pen) { |
|
468 | if (forced || QChartPrivate::defaultPen() == m_pen) { | |
463 | QPen pen = theme->outlinePen(); |
|
469 | QPen pen = theme->outlinePen(); | |
464 | pen.setCosmetic(true); |
|
470 | pen.setCosmetic(true); | |
465 | q->setPen(pen); |
|
471 | q->setPen(pen); | |
466 | } |
|
472 | } | |
467 | } |
|
473 | } | |
468 |
|
474 | |||
469 | void QBoxPlotSeriesPrivate::initializeAnimations(QChart::AnimationOptions options) |
|
475 | void QBoxPlotSeriesPrivate::initializeAnimations(QChart::AnimationOptions options) | |
470 | { |
|
476 | { | |
471 | BoxPlotChartItem *item = static_cast<BoxPlotChartItem *>(m_item.data()); |
|
477 | BoxPlotChartItem *item = static_cast<BoxPlotChartItem *>(m_item.data()); | |
472 | Q_ASSERT(item); |
|
478 | Q_ASSERT(item); | |
473 | if (item->animation()) |
|
479 | if (item->animation()) | |
474 | item->animation()->stopAndDestroyLater(); |
|
480 | item->animation()->stopAndDestroyLater(); | |
475 |
|
481 | |||
476 | if (options.testFlag(QChart::SeriesAnimations)) |
|
482 | if (options.testFlag(QChart::SeriesAnimations)) | |
477 | m_animation = new BoxPlotAnimation(item); |
|
483 | m_animation = new BoxPlotAnimation(item); | |
478 | else |
|
484 | else | |
479 | m_animation = 0; |
|
485 | m_animation = 0; | |
480 | item->setAnimation(m_animation); |
|
486 | item->setAnimation(m_animation); | |
481 |
|
487 | |||
482 | QAbstractSeriesPrivate::initializeAnimations(options); |
|
488 | QAbstractSeriesPrivate::initializeAnimations(options); | |
483 | } |
|
489 | } | |
484 |
|
490 | |||
485 | QList<QLegendMarker*> QBoxPlotSeriesPrivate::createLegendMarkers(QLegend *legend) |
|
491 | QList<QLegendMarker*> QBoxPlotSeriesPrivate::createLegendMarkers(QLegend *legend) | |
486 | { |
|
492 | { | |
487 | Q_Q(QBoxPlotSeries); |
|
493 | Q_Q(QBoxPlotSeries); | |
488 | QList<QLegendMarker *> list; |
|
494 | QList<QLegendMarker *> list; | |
489 | return list << new QBoxPlotLegendMarker(q, legend); |
|
495 | return list << new QBoxPlotLegendMarker(q, legend); | |
490 | } |
|
496 | } | |
491 |
|
497 | |||
492 | void QBoxPlotSeriesPrivate::handleSeriesRemove(QAbstractSeries *series) |
|
498 | void QBoxPlotSeriesPrivate::handleSeriesRemove(QAbstractSeries *series) | |
493 | { |
|
499 | { | |
494 | Q_Q(QBoxPlotSeries); |
|
500 | Q_Q(QBoxPlotSeries); | |
495 |
|
501 | |||
496 | QBoxPlotSeries *removedSeries = static_cast<QBoxPlotSeries *>(series); |
|
502 | QBoxPlotSeries *removedSeries = static_cast<QBoxPlotSeries *>(series); | |
497 |
|
503 | |||
498 | if (q == removedSeries && m_animation) { |
|
504 | if (q == removedSeries && m_animation) { | |
499 | m_animation->stopAll(); |
|
505 | m_animation->stopAll(); | |
500 | QObject::disconnect(m_chart->d_ptr->m_dataset, 0, removedSeries->d_func(), 0); |
|
506 | QObject::disconnect(m_chart->d_ptr->m_dataset, 0, removedSeries->d_func(), 0); | |
501 | } |
|
507 | } | |
502 |
|
508 | |||
503 | // Test if series removed is me, then don't do anything |
|
509 | // Test if series removed is me, then don't do anything | |
504 | if (q != removedSeries) { |
|
510 | if (q != removedSeries) { | |
505 | BoxPlotChartItem *item = static_cast<BoxPlotChartItem *>(m_item.data()); |
|
511 | BoxPlotChartItem *item = static_cast<BoxPlotChartItem *>(m_item.data()); | |
506 | if (item) { |
|
512 | if (item) { | |
507 | item->m_seriesCount = item->m_seriesCount - 1; |
|
513 | item->m_seriesCount = item->m_seriesCount - 1; | |
508 | if (removedSeries->d_func()->m_index < m_index) { |
|
514 | if (removedSeries->d_func()->m_index < m_index) { | |
509 | m_index--; |
|
515 | m_index--; | |
510 | item->m_seriesIndex = m_index; |
|
516 | item->m_seriesIndex = m_index; | |
511 | } |
|
517 | } | |
512 |
|
518 | |||
513 | item->handleDataStructureChanged(); |
|
519 | item->handleDataStructureChanged(); | |
514 | } |
|
520 | } | |
515 | } |
|
521 | } | |
516 | } |
|
522 | } | |
517 |
|
523 | |||
518 | void QBoxPlotSeriesPrivate::handleSeriesChange(QAbstractSeries *series) |
|
524 | void QBoxPlotSeriesPrivate::handleSeriesChange(QAbstractSeries *series) | |
519 | { |
|
525 | { | |
520 | Q_UNUSED(series); |
|
526 | Q_UNUSED(series); | |
521 |
|
527 | |||
522 | Q_Q(QBoxPlotSeries); |
|
528 | Q_Q(QBoxPlotSeries); | |
523 |
|
529 | |||
524 | BoxPlotChartItem *boxPlot = static_cast<BoxPlotChartItem *>(m_item.data()); |
|
530 | BoxPlotChartItem *boxPlot = static_cast<BoxPlotChartItem *>(m_item.data()); | |
525 |
|
531 | |||
526 | if (m_chart) { |
|
532 | if (m_chart) { | |
527 | QList<QAbstractSeries *> serieses = m_chart->series(); |
|
533 | QList<QAbstractSeries *> serieses = m_chart->series(); | |
528 |
|
534 | |||
529 | // Tries to find this series from the Chart's list of series and deduce the index |
|
535 | // Tries to find this series from the Chart's list of series and deduce the index | |
530 | int index = 0; |
|
536 | int index = 0; | |
531 | foreach (QAbstractSeries *s, serieses) { |
|
537 | foreach (QAbstractSeries *s, serieses) { | |
532 | if (s->type() == QAbstractSeries::SeriesTypeBoxPlot) { |
|
538 | if (s->type() == QAbstractSeries::SeriesTypeBoxPlot) { | |
533 | if (q == static_cast<QBoxPlotSeries *>(s)) { |
|
539 | if (q == static_cast<QBoxPlotSeries *>(s)) { | |
534 | boxPlot->m_seriesIndex = index; |
|
540 | boxPlot->m_seriesIndex = index; | |
535 | m_index = index; |
|
541 | m_index = index; | |
536 | } |
|
542 | } | |
537 | index++; |
|
543 | index++; | |
538 | } |
|
544 | } | |
539 | } |
|
545 | } | |
540 | boxPlot->m_seriesCount = index; |
|
546 | boxPlot->m_seriesCount = index; | |
541 | } |
|
547 | } | |
542 |
|
548 | |||
543 | boxPlot->handleDataStructureChanged(); |
|
549 | boxPlot->handleDataStructureChanged(); | |
544 | } |
|
550 | } | |
545 |
|
551 | |||
546 | bool QBoxPlotSeriesPrivate::append(QBoxSet *set) |
|
552 | bool QBoxPlotSeriesPrivate::append(QBoxSet *set) | |
547 | { |
|
553 | { | |
548 | if (m_boxSets.contains(set) || (set == 0) || set->d_ptr->m_series) |
|
554 | if (m_boxSets.contains(set) || (set == 0) || set->d_ptr->m_series) | |
549 | return false; // Fail if set is already in list or set is null. |
|
555 | return false; // Fail if set is already in list or set is null. | |
550 |
|
556 | |||
551 | m_boxSets.append(set); |
|
557 | m_boxSets.append(set); | |
552 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); |
|
558 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); | |
553 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); |
|
559 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); | |
554 | QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); |
|
560 | QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); | |
555 | set->d_ptr->m_series = this; |
|
561 | set->d_ptr->m_series = this; | |
556 |
|
562 | |||
557 | emit restructuredBoxes(); // this notifies boxplotchartitem |
|
563 | emit restructuredBoxes(); // this notifies boxplotchartitem | |
558 | return true; |
|
564 | return true; | |
559 | } |
|
565 | } | |
560 |
|
566 | |||
561 | bool QBoxPlotSeriesPrivate::remove(QBoxSet *set) |
|
567 | bool QBoxPlotSeriesPrivate::remove(QBoxSet *set) | |
562 | { |
|
568 | { | |
563 | if (!m_boxSets.contains(set)) |
|
569 | if (!m_boxSets.contains(set)) | |
564 | return false; // Fail if set is not in list |
|
570 | return false; // Fail if set is not in list | |
565 |
|
571 | |||
566 | set->d_ptr->m_series = 0; |
|
572 | set->d_ptr->m_series = 0; | |
567 | m_boxSets.removeOne(set); |
|
573 | m_boxSets.removeOne(set); | |
568 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); |
|
574 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); | |
569 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); |
|
575 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); | |
570 | QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); |
|
576 | QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); | |
571 |
|
577 | |||
572 | emit restructuredBoxes(); // this notifies boxplotchartitem |
|
578 | emit restructuredBoxes(); // this notifies boxplotchartitem | |
573 | return true; |
|
579 | return true; | |
574 | } |
|
580 | } | |
575 |
|
581 | |||
576 | bool QBoxPlotSeriesPrivate::append(QList<QBoxSet *> sets) |
|
582 | bool QBoxPlotSeriesPrivate::append(QList<QBoxSet *> sets) | |
577 | { |
|
583 | { | |
578 | foreach (QBoxSet *set, sets) { |
|
584 | foreach (QBoxSet *set, sets) { | |
579 | if ((set == 0) || m_boxSets.contains(set) || set->d_ptr->m_series) |
|
585 | if ((set == 0) || m_boxSets.contains(set) || set->d_ptr->m_series) | |
580 | return false; // Fail if any of the sets is null or is already appended. |
|
586 | return false; // Fail if any of the sets is null or is already appended. | |
581 | if (sets.count(set) != 1) |
|
587 | if (sets.count(set) != 1) | |
582 | return false; // Also fail if same set is more than once in given list. |
|
588 | return false; // Also fail if same set is more than once in given list. | |
583 | } |
|
589 | } | |
584 |
|
590 | |||
585 | foreach (QBoxSet *set, sets) { |
|
591 | foreach (QBoxSet *set, sets) { | |
586 | m_boxSets.append(set); |
|
592 | m_boxSets.append(set); | |
587 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); |
|
593 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); | |
588 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); |
|
594 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); | |
589 | QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); |
|
595 | QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); | |
590 | set->d_ptr->m_series = this; |
|
596 | set->d_ptr->m_series = this; | |
591 | } |
|
597 | } | |
592 |
|
598 | |||
593 | emit restructuredBoxes(); // this notifies boxplotchartitem |
|
599 | emit restructuredBoxes(); // this notifies boxplotchartitem | |
594 | return true; |
|
600 | return true; | |
595 | } |
|
601 | } | |
596 |
|
602 | |||
597 | bool QBoxPlotSeriesPrivate::remove(QList<QBoxSet *> sets) |
|
603 | bool QBoxPlotSeriesPrivate::remove(QList<QBoxSet *> sets) | |
598 | { |
|
604 | { | |
599 | if (sets.count() == 0) |
|
605 | if (sets.count() == 0) | |
600 | return false; |
|
606 | return false; | |
601 |
|
607 | |||
602 | foreach (QBoxSet *set, sets) { |
|
608 | foreach (QBoxSet *set, sets) { | |
603 | if ((set == 0) || (!m_boxSets.contains(set))) |
|
609 | if ((set == 0) || (!m_boxSets.contains(set))) | |
604 | return false; // Fail if any of the sets is null or is not in series |
|
610 | return false; // Fail if any of the sets is null or is not in series | |
605 | if (sets.count(set) != 1) |
|
611 | if (sets.count(set) != 1) | |
606 | return false; // Also fail if same set is more than once in given list. |
|
612 | return false; // Also fail if same set is more than once in given list. | |
607 | } |
|
613 | } | |
608 |
|
614 | |||
609 | foreach (QBoxSet *set, sets) { |
|
615 | foreach (QBoxSet *set, sets) { | |
610 | set->d_ptr->m_series = 0; |
|
616 | set->d_ptr->m_series = 0; | |
611 | m_boxSets.removeOne(set); |
|
617 | m_boxSets.removeOne(set); | |
612 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); |
|
618 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); | |
613 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); |
|
619 | QObject::disconnect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); | |
614 | QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); |
|
620 | QObject::disconnect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); | |
615 | } |
|
621 | } | |
616 |
|
622 | |||
617 | emit restructuredBoxes(); // this notifies boxplotchartitem |
|
623 | emit restructuredBoxes(); // this notifies boxplotchartitem | |
618 |
|
624 | |||
619 | return true; |
|
625 | return true; | |
620 | } |
|
626 | } | |
621 |
|
627 | |||
622 | bool QBoxPlotSeriesPrivate::insert(int index, QBoxSet *set) |
|
628 | bool QBoxPlotSeriesPrivate::insert(int index, QBoxSet *set) | |
623 | { |
|
629 | { | |
624 | if ((m_boxSets.contains(set)) || (set == 0) || set->d_ptr->m_series) |
|
630 | if ((m_boxSets.contains(set)) || (set == 0) || set->d_ptr->m_series) | |
625 | return false; // Fail if set is already in list or set is null. |
|
631 | return false; // Fail if set is already in list or set is null. | |
626 |
|
632 | |||
627 | m_boxSets.insert(index, set); |
|
633 | m_boxSets.insert(index, set); | |
628 | set->d_ptr->m_series = this; |
|
634 | set->d_ptr->m_series = this; | |
629 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); |
|
635 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedLayout()), this, SIGNAL(updatedLayout())); | |
630 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); |
|
636 | QObject::connect(set->d_ptr.data(), SIGNAL(updatedBox()), this, SIGNAL(updatedBoxes())); | |
631 | QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); |
|
637 | QObject::connect(set->d_ptr.data(), SIGNAL(restructuredBox()), this, SIGNAL(restructuredBoxes())); | |
632 |
|
638 | |||
633 | emit restructuredBoxes(); // this notifies boxplotchartitem |
|
639 | emit restructuredBoxes(); // this notifies boxplotchartitem | |
634 | return true; |
|
640 | return true; | |
635 | } |
|
641 | } | |
636 |
|
642 | |||
637 | QBoxSet *QBoxPlotSeriesPrivate::boxSetAt(int index) |
|
643 | QBoxSet *QBoxPlotSeriesPrivate::boxSetAt(int index) | |
638 | { |
|
644 | { | |
639 | return m_boxSets.at(index); |
|
645 | return m_boxSets.at(index); | |
640 | } |
|
646 | } | |
641 |
|
647 | |||
642 | qreal QBoxPlotSeriesPrivate::min() |
|
648 | qreal QBoxPlotSeriesPrivate::min() | |
643 | { |
|
649 | { | |
644 | if (m_boxSets.count() <= 0) |
|
650 | if (m_boxSets.count() <= 0) | |
645 | return 0; |
|
651 | return 0; | |
646 |
|
652 | |||
647 | qreal min = m_boxSets.at(0)->at(0); |
|
653 | qreal min = m_boxSets.at(0)->at(0); | |
648 |
|
654 | |||
649 | foreach (QBoxSet *set, m_boxSets) { |
|
655 | foreach (QBoxSet *set, m_boxSets) { | |
650 | for (int i = 0; i < 5; i++) { |
|
656 | for (int i = 0; i < 5; i++) { | |
651 | if (set->at(i) < min) |
|
657 | if (set->at(i) < min) | |
652 | min = set->at(i); |
|
658 | min = set->at(i); | |
653 | } |
|
659 | } | |
654 | } |
|
660 | } | |
655 |
|
661 | |||
656 | return min; |
|
662 | return min; | |
657 | } |
|
663 | } | |
658 |
|
664 | |||
659 | qreal QBoxPlotSeriesPrivate::max() |
|
665 | qreal QBoxPlotSeriesPrivate::max() | |
660 | { |
|
666 | { | |
661 | if (m_boxSets.count() <= 0) |
|
667 | if (m_boxSets.count() <= 0) | |
662 | return 0; |
|
668 | return 0; | |
663 |
|
669 | |||
664 | qreal max = m_boxSets.at(0)->at(0); |
|
670 | qreal max = m_boxSets.at(0)->at(0); | |
665 |
|
671 | |||
666 | foreach (QBoxSet *set, m_boxSets) { |
|
672 | foreach (QBoxSet *set, m_boxSets) { | |
667 | for (int i = 0; i < 5; i++) { |
|
673 | for (int i = 0; i < 5; i++) { | |
668 | if (set->at(i) > max) |
|
674 | if (set->at(i) > max) | |
669 | max = set->at(i); |
|
675 | max = set->at(i); | |
670 | } |
|
676 | } | |
671 | } |
|
677 | } | |
672 |
|
678 | |||
673 | return max; |
|
679 | return max; | |
674 | } |
|
680 | } | |
675 |
|
681 | |||
676 | #include "moc_qboxplotseries.cpp" |
|
682 | #include "moc_qboxplotseries.cpp" | |
677 | #include "moc_qboxplotseries_p.cpp" |
|
683 | #include "moc_qboxplotseries_p.cpp" | |
678 |
|
684 | |||
679 | QTCOMMERCIALCHART_END_NAMESPACE |
|
685 | QTCOMMERCIALCHART_END_NAMESPACE | |
680 |
|
686 |
@@ -1,330 +1,336 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qboxset.h" |
|
21 | #include "qboxset.h" | |
22 | #include "qboxset_p.h" |
|
22 | #include "qboxset_p.h" | |
23 | #include "charthelpers_p.h" |
|
23 | #include "charthelpers_p.h" | |
24 |
|
24 | |||
25 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
25 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
26 |
|
26 | |||
27 | /*! |
|
27 | /*! | |
28 | \class QBoxSet |
|
28 | \class QBoxSet | |
29 | \inmodule Qt Charts |
|
29 | \inmodule Qt Charts | |
30 | \brief Building block for box-and-whiskers chart |
|
30 | \brief Building block for box-and-whiskers chart | |
31 |
|
31 | |||
32 | QBoxSet represents one box-and-whiskers item. It takes five values to create a graphical representation |
|
32 | QBoxSet represents one box-and-whiskers item. It takes five values to create a graphical representation | |
33 | of range and three medians. There are two ways to give the values. The first one is with constructor |
|
33 | of range and three medians. There are two ways to give the values. The first one is with constructor | |
34 | or stream operator (<<). The values have to be given in the following order: lower extreme, |
|
34 | or stream operator (<<). The values have to be given in the following order: lower extreme, | |
35 | lower quartile, median, upper quartile and upper extreme. The Second method is to create an empty QBoxSet instance and |
|
35 | lower quartile, median, upper quartile and upper extreme. The Second method is to create an empty QBoxSet instance and | |
36 | give the values using setValue method. |
|
36 | give the values using setValue method. | |
37 |
|
37 | |||
38 | \mainclass |
|
38 | \mainclass | |
39 |
|
39 | |||
40 | \sa QBoxPlotSeries |
|
40 | \sa QBoxPlotSeries | |
41 | */ |
|
41 | */ | |
42 | /*! |
|
42 | /*! | |
43 | \enum QBoxSet::ValuePositions |
|
43 | \enum QBoxSet::ValuePositions | |
44 |
|
44 | |||
45 | \value LowerExtreme |
|
45 | \value LowerExtreme | |
46 | \value LowerQuartile |
|
46 | \value LowerQuartile | |
47 | \value Median |
|
47 | \value Median | |
48 | \value UpperQuartile |
|
48 | \value UpperQuartile | |
49 | \value UpperExtreme |
|
49 | \value UpperExtreme | |
50 | */ |
|
50 | */ | |
51 | /*! |
|
51 | /*! | |
52 | \property QBoxSet::pen |
|
52 | \property QBoxSet::pen | |
53 | \brief Defines the pen used by the box-and-whiskers set. |
|
53 | \brief Defines the pen used by the box-and-whiskers set. | |
54 | */ |
|
54 | */ | |
55 | /*! |
|
55 | /*! | |
56 | \property QBoxSet::brush |
|
56 | \property QBoxSet::brush | |
57 | \brief Defines the brush used by the box-and-whiskers set. |
|
57 | \brief Defines the brush used by the box-and-whiskers set. | |
58 | */ |
|
58 | */ | |
|
59 | ||||
|
60 | /*! | |||
|
61 | \qmlproperty QString BoxSet::brushFilename | |||
|
62 | The name of the file used as a brush for the box-and-whiskers set. | |||
|
63 | */ | |||
|
64 | ||||
59 | /*! |
|
65 | /*! | |
60 | \fn void QBoxSet::clicked() |
|
66 | \fn void QBoxSet::clicked() | |
61 | The signal is emitted if the user clicks with a mouse on top of box-and-whisker item. |
|
67 | The signal is emitted if the user clicks with a mouse on top of box-and-whisker item. | |
62 | */ |
|
68 | */ | |
63 | /*! |
|
69 | /*! | |
64 | \fn void QBoxSet::hovered(bool status) |
|
70 | \fn void QBoxSet::hovered(bool status) | |
65 |
|
71 | |||
66 | The signal is emitted if mouse is hovered on top of box-and-whisker item. |
|
72 | The signal is emitted if mouse is hovered on top of box-and-whisker item. | |
67 | Parameter \a status is true, if mouse entered on top of item, false if mouse left from top of item. |
|
73 | Parameter \a status is true, if mouse entered on top of item, false if mouse left from top of item. | |
68 | */ |
|
74 | */ | |
69 | /*! |
|
75 | /*! | |
70 | \fn void QBoxSet::penChanged() |
|
76 | \fn void QBoxSet::penChanged() | |
71 | This signal is emitted when the pen of the box-and-whisker item has changed. |
|
77 | This signal is emitted when the pen of the box-and-whisker item has changed. | |
72 | \sa pen |
|
78 | \sa pen | |
73 | */ |
|
79 | */ | |
74 | /*! |
|
80 | /*! | |
75 | \fn void QBoxSet::brushChanged() |
|
81 | \fn void QBoxSet::brushChanged() | |
76 | This signal is emitted when the brush of the box-and-whisker item has changed. |
|
82 | This signal is emitted when the brush of the box-and-whisker item has changed. | |
77 | \sa brush |
|
83 | \sa brush | |
78 | */ |
|
84 | */ | |
79 | /*! |
|
85 | /*! | |
80 | \fn void QBoxSet::valuesChanged() |
|
86 | \fn void QBoxSet::valuesChanged() | |
81 | This signal is emitted when multiple values have been changed on the box-and-whisker item. |
|
87 | This signal is emitted when multiple values have been changed on the box-and-whisker item. | |
82 | \sa append() |
|
88 | \sa append() | |
83 | */ |
|
89 | */ | |
84 | /*! |
|
90 | /*! | |
85 | \fn void QBoxSet::valueChanged(int index) |
|
91 | \fn void QBoxSet::valueChanged(int index) | |
86 | This signal is emitted values the value in the box-and-whisker item has been modified. |
|
92 | This signal is emitted values the value in the box-and-whisker item has been modified. | |
87 | Parameter \a index indicates the position of the modified value. |
|
93 | Parameter \a index indicates the position of the modified value. | |
88 | \sa at() |
|
94 | \sa at() | |
89 | */ |
|
95 | */ | |
90 | /*! |
|
96 | /*! | |
91 | \fn void QBoxSet::cleared() |
|
97 | \fn void QBoxSet::cleared() | |
92 | This signal is emitted when all the values on the set are cleared to 0. |
|
98 | This signal is emitted when all the values on the set are cleared to 0. | |
93 | */ |
|
99 | */ | |
94 |
|
100 | |||
95 | /*! |
|
101 | /*! | |
96 | Constructs QBoxSet with optional \a label and parent of \a parent |
|
102 | Constructs QBoxSet with optional \a label and parent of \a parent | |
97 | */ |
|
103 | */ | |
98 | QBoxSet::QBoxSet(const QString label, QObject *parent) |
|
104 | QBoxSet::QBoxSet(const QString label, QObject *parent) | |
99 | : QObject(parent), |
|
105 | : QObject(parent), | |
100 | d_ptr(new QBoxSetPrivate(label, this)) |
|
106 | d_ptr(new QBoxSetPrivate(label, this)) | |
101 | { |
|
107 | { | |
102 | } |
|
108 | } | |
103 |
|
109 | |||
104 | /*! |
|
110 | /*! | |
105 | Constructs QBoxSet with given ordered values. \a le for lower extreme, \a lq for lower quartile, \a m for median, |
|
111 | Constructs QBoxSet with given ordered values. \a le for lower extreme, \a lq for lower quartile, \a m for median, | |
106 | \a uq for upper quartile and \a ue for upper quartile. \a label and \a parent are optional. |
|
112 | \a uq for upper quartile and \a ue for upper quartile. \a label and \a parent are optional. | |
107 | */ |
|
113 | */ | |
108 | QBoxSet::QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label, QObject *parent) |
|
114 | QBoxSet::QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label, QObject *parent) | |
109 | : QObject(parent), |
|
115 | : QObject(parent), | |
110 | d_ptr(new QBoxSetPrivate(label, this)) |
|
116 | d_ptr(new QBoxSetPrivate(label, this)) | |
111 | { |
|
117 | { | |
112 | d_ptr->append(le); |
|
118 | d_ptr->append(le); | |
113 | d_ptr->append(lq); |
|
119 | d_ptr->append(lq); | |
114 | d_ptr->append(m); |
|
120 | d_ptr->append(m); | |
115 | d_ptr->append(uq); |
|
121 | d_ptr->append(uq); | |
116 | d_ptr->append(ue); |
|
122 | d_ptr->append(ue); | |
117 | } |
|
123 | } | |
118 |
|
124 | |||
119 | /*! |
|
125 | /*! | |
120 | Destroys the boxset |
|
126 | Destroys the boxset | |
121 | */ |
|
127 | */ | |
122 | QBoxSet::~QBoxSet() |
|
128 | QBoxSet::~QBoxSet() | |
123 | { |
|
129 | { | |
124 | } |
|
130 | } | |
125 |
|
131 | |||
126 | /*! |
|
132 | /*! | |
127 | Appends new value \a value to the end of set. |
|
133 | Appends new value \a value to the end of set. | |
128 | */ |
|
134 | */ | |
129 | void QBoxSet::append(const qreal value) |
|
135 | void QBoxSet::append(const qreal value) | |
130 | { |
|
136 | { | |
131 | if (d_ptr->append(value)) |
|
137 | if (d_ptr->append(value)) | |
132 | emit valueChanged(d_ptr->m_appendCount - 1); |
|
138 | emit valueChanged(d_ptr->m_appendCount - 1); | |
133 | } |
|
139 | } | |
134 |
|
140 | |||
135 | /*! |
|
141 | /*! | |
136 | Appends a list of reals to set. Works like append with single real value. The \a values in list |
|
142 | Appends a list of reals to set. Works like append with single real value. The \a values in list | |
137 | are appended to end of boxset. |
|
143 | are appended to end of boxset. | |
138 | \sa append() |
|
144 | \sa append() | |
139 | */ |
|
145 | */ | |
140 | void QBoxSet::append(const QList<qreal> &values) |
|
146 | void QBoxSet::append(const QList<qreal> &values) | |
141 | { |
|
147 | { | |
142 | if (d_ptr->append(values)) |
|
148 | if (d_ptr->append(values)) | |
143 | emit valuesChanged(); |
|
149 | emit valuesChanged(); | |
144 | } |
|
150 | } | |
145 |
|
151 | |||
146 | /*! |
|
152 | /*! | |
147 | Sets new \a label for set. |
|
153 | Sets new \a label for set. | |
148 | */ |
|
154 | */ | |
149 | void QBoxSet::setLabel(const QString label) |
|
155 | void QBoxSet::setLabel(const QString label) | |
150 | { |
|
156 | { | |
151 | d_ptr->m_label = label; |
|
157 | d_ptr->m_label = label; | |
152 | } |
|
158 | } | |
153 |
|
159 | |||
154 | /*! |
|
160 | /*! | |
155 | Returns label of the set. |
|
161 | Returns label of the set. | |
156 | */ |
|
162 | */ | |
157 | QString QBoxSet::label() const |
|
163 | QString QBoxSet::label() const | |
158 | { |
|
164 | { | |
159 | return d_ptr->m_label; |
|
165 | return d_ptr->m_label; | |
160 | } |
|
166 | } | |
161 |
|
167 | |||
162 | /*! |
|
168 | /*! | |
163 | Convenience operator. Same as append, with real \a value. |
|
169 | Convenience operator. Same as append, with real \a value. | |
164 | \sa append() |
|
170 | \sa append() | |
165 | */ |
|
171 | */ | |
166 | QBoxSet &QBoxSet::operator << (const qreal &value) |
|
172 | QBoxSet &QBoxSet::operator << (const qreal &value) | |
167 | { |
|
173 | { | |
168 | append(value); |
|
174 | append(value); | |
169 | return *this; |
|
175 | return *this; | |
170 | } |
|
176 | } | |
171 |
|
177 | |||
172 | /*! |
|
178 | /*! | |
173 | Sets a new \a value on the \a index position. For \a index ValuePositions can be used. |
|
179 | Sets a new \a value on the \a index position. For \a index ValuePositions can be used. | |
174 | */ |
|
180 | */ | |
175 | void QBoxSet::setValue(const int index, const qreal value) |
|
181 | void QBoxSet::setValue(const int index, const qreal value) | |
176 | { |
|
182 | { | |
177 | d_ptr->setValue(index, value); |
|
183 | d_ptr->setValue(index, value); | |
178 | emit valueChanged(index); |
|
184 | emit valueChanged(index); | |
179 | } |
|
185 | } | |
180 |
|
186 | |||
181 | /*! |
|
187 | /*! | |
182 | Sets all values on the set to 0. |
|
188 | Sets all values on the set to 0. | |
183 | */ |
|
189 | */ | |
184 | void QBoxSet::clear() |
|
190 | void QBoxSet::clear() | |
185 | { |
|
191 | { | |
186 | d_ptr->clear(); |
|
192 | d_ptr->clear(); | |
187 | emit cleared(); |
|
193 | emit cleared(); | |
188 | } |
|
194 | } | |
189 |
|
195 | |||
190 | /*! |
|
196 | /*! | |
191 | Returns value of set indexed by \a index. For \a index ValuePositions can be used. |
|
197 | Returns value of set indexed by \a index. For \a index ValuePositions can be used. | |
192 | If the index is out of bounds 0.0 is returned. |
|
198 | If the index is out of bounds 0.0 is returned. | |
193 | */ |
|
199 | */ | |
194 | qreal QBoxSet::at(const int index) const |
|
200 | qreal QBoxSet::at(const int index) const | |
195 | { |
|
201 | { | |
196 | if (index < 0 || index >= 5) |
|
202 | if (index < 0 || index >= 5) | |
197 | return 0; |
|
203 | return 0; | |
198 | return d_ptr->m_values[index]; |
|
204 | return d_ptr->m_values[index]; | |
199 | } |
|
205 | } | |
200 |
|
206 | |||
201 | /*! |
|
207 | /*! | |
202 | Returns value of set indexed by \a index. For \a index ValuePositions can be used. |
|
208 | Returns value of set indexed by \a index. For \a index ValuePositions can be used. | |
203 | If the index is out of bounds 0.0 is returned. |
|
209 | If the index is out of bounds 0.0 is returned. | |
204 | */ |
|
210 | */ | |
205 | qreal QBoxSet::operator [](const int index) const |
|
211 | qreal QBoxSet::operator [](const int index) const | |
206 | { |
|
212 | { | |
207 | return at(index); |
|
213 | return at(index); | |
208 | } |
|
214 | } | |
209 |
|
215 | |||
210 | /*! |
|
216 | /*! | |
211 | Returns count of values appended to the set. |
|
217 | Returns count of values appended to the set. | |
212 | */ |
|
218 | */ | |
213 | int QBoxSet::count() const |
|
219 | int QBoxSet::count() const | |
214 | { |
|
220 | { | |
215 | return d_ptr->m_appendCount; |
|
221 | return d_ptr->m_appendCount; | |
216 | } |
|
222 | } | |
217 |
|
223 | |||
218 | /*! |
|
224 | /*! | |
219 | Sets pen for set. Boxes of this set are drawn using \a pen |
|
225 | Sets pen for set. Boxes of this set are drawn using \a pen | |
220 | */ |
|
226 | */ | |
221 | void QBoxSet::setPen(const QPen &pen) |
|
227 | void QBoxSet::setPen(const QPen &pen) | |
222 | { |
|
228 | { | |
223 | if (d_ptr->m_pen != pen) { |
|
229 | if (d_ptr->m_pen != pen) { | |
224 | d_ptr->m_pen = pen; |
|
230 | d_ptr->m_pen = pen; | |
225 | emit d_ptr->updatedBox(); |
|
231 | emit d_ptr->updatedBox(); | |
226 | emit penChanged(); |
|
232 | emit penChanged(); | |
227 | } |
|
233 | } | |
228 | } |
|
234 | } | |
229 |
|
235 | |||
230 | /*! |
|
236 | /*! | |
231 | Returns pen of the set. |
|
237 | Returns pen of the set. | |
232 | */ |
|
238 | */ | |
233 | QPen QBoxSet::pen() const |
|
239 | QPen QBoxSet::pen() const | |
234 | { |
|
240 | { | |
235 | return d_ptr->m_pen; |
|
241 | return d_ptr->m_pen; | |
236 | } |
|
242 | } | |
237 |
|
243 | |||
238 | /*! |
|
244 | /*! | |
239 | Sets brush for the set. Boxes of this set are drawn using \a brush |
|
245 | Sets brush for the set. Boxes of this set are drawn using \a brush | |
240 | */ |
|
246 | */ | |
241 | void QBoxSet::setBrush(const QBrush &brush) |
|
247 | void QBoxSet::setBrush(const QBrush &brush) | |
242 | { |
|
248 | { | |
243 | if (d_ptr->m_brush != brush) { |
|
249 | if (d_ptr->m_brush != brush) { | |
244 | d_ptr->m_brush = brush; |
|
250 | d_ptr->m_brush = brush; | |
245 | emit d_ptr->updatedBox(); |
|
251 | emit d_ptr->updatedBox(); | |
246 | emit brushChanged(); |
|
252 | emit brushChanged(); | |
247 | } |
|
253 | } | |
248 | } |
|
254 | } | |
249 |
|
255 | |||
250 | /*! |
|
256 | /*! | |
251 | Returns brush of the set. |
|
257 | Returns brush of the set. | |
252 | */ |
|
258 | */ | |
253 | QBrush QBoxSet::brush() const |
|
259 | QBrush QBoxSet::brush() const | |
254 | { |
|
260 | { | |
255 | return d_ptr->m_brush; |
|
261 | return d_ptr->m_brush; | |
256 | } |
|
262 | } | |
257 |
|
263 | |||
258 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
264 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
259 |
|
265 | |||
260 | QBoxSetPrivate::QBoxSetPrivate(const QString label, QBoxSet *parent) : QObject(parent), |
|
266 | QBoxSetPrivate::QBoxSetPrivate(const QString label, QBoxSet *parent) : QObject(parent), | |
261 | q_ptr(parent), |
|
267 | q_ptr(parent), | |
262 | m_label(label), |
|
268 | m_label(label), | |
263 | m_valuesCount(5), |
|
269 | m_valuesCount(5), | |
264 | m_appendCount(0), |
|
270 | m_appendCount(0), | |
265 | m_pen(QPen(Qt::NoPen)), |
|
271 | m_pen(QPen(Qt::NoPen)), | |
266 | m_brush(QBrush(Qt::NoBrush)), |
|
272 | m_brush(QBrush(Qt::NoBrush)), | |
267 | m_series(0) |
|
273 | m_series(0) | |
268 | { |
|
274 | { | |
269 | m_values = new qreal[m_valuesCount]; |
|
275 | m_values = new qreal[m_valuesCount]; | |
270 | } |
|
276 | } | |
271 |
|
277 | |||
272 | QBoxSetPrivate::~QBoxSetPrivate() |
|
278 | QBoxSetPrivate::~QBoxSetPrivate() | |
273 | { |
|
279 | { | |
274 | } |
|
280 | } | |
275 |
|
281 | |||
276 | bool QBoxSetPrivate::append(qreal value) |
|
282 | bool QBoxSetPrivate::append(qreal value) | |
277 | { |
|
283 | { | |
278 | if (isValidValue(value) && m_appendCount < m_valuesCount) { |
|
284 | if (isValidValue(value) && m_appendCount < m_valuesCount) { | |
279 | m_values[m_appendCount++] = value; |
|
285 | m_values[m_appendCount++] = value; | |
280 | emit restructuredBox(); |
|
286 | emit restructuredBox(); | |
281 |
|
287 | |||
282 | return true; |
|
288 | return true; | |
283 | } |
|
289 | } | |
284 | return false; |
|
290 | return false; | |
285 | } |
|
291 | } | |
286 |
|
292 | |||
287 | bool QBoxSetPrivate::append(QList<qreal> values) |
|
293 | bool QBoxSetPrivate::append(QList<qreal> values) | |
288 | { |
|
294 | { | |
289 | bool success = false; |
|
295 | bool success = false; | |
290 |
|
296 | |||
291 | for (int i = 0; i < values.count(); i++) { |
|
297 | for (int i = 0; i < values.count(); i++) { | |
292 | if (isValidValue(values.at(i)) && m_appendCount < m_valuesCount) { |
|
298 | if (isValidValue(values.at(i)) && m_appendCount < m_valuesCount) { | |
293 | success = true; |
|
299 | success = true; | |
294 | m_values[m_appendCount++] = values.at(i); |
|
300 | m_values[m_appendCount++] = values.at(i); | |
295 | } |
|
301 | } | |
296 | } |
|
302 | } | |
297 |
|
303 | |||
298 | if (success) |
|
304 | if (success) | |
299 | emit restructuredBox(); |
|
305 | emit restructuredBox(); | |
300 |
|
306 | |||
301 | return success; |
|
307 | return success; | |
302 | } |
|
308 | } | |
303 |
|
309 | |||
304 | void QBoxSetPrivate::clear() |
|
310 | void QBoxSetPrivate::clear() | |
305 | { |
|
311 | { | |
306 | m_appendCount = 0; |
|
312 | m_appendCount = 0; | |
307 | for (int i = 0; i < m_valuesCount; i++) |
|
313 | for (int i = 0; i < m_valuesCount; i++) | |
308 | m_values[i] = 0.0; |
|
314 | m_values[i] = 0.0; | |
309 | emit restructuredBox(); |
|
315 | emit restructuredBox(); | |
310 | } |
|
316 | } | |
311 |
|
317 | |||
312 | void QBoxSetPrivate::setValue(const int index, const qreal value) |
|
318 | void QBoxSetPrivate::setValue(const int index, const qreal value) | |
313 | { |
|
319 | { | |
314 | if (index < m_valuesCount) { |
|
320 | if (index < m_valuesCount) { | |
315 | m_values[index] = value; |
|
321 | m_values[index] = value; | |
316 | emit updatedLayout(); |
|
322 | emit updatedLayout(); | |
317 | } |
|
323 | } | |
318 | } |
|
324 | } | |
319 |
|
325 | |||
320 | qreal QBoxSetPrivate::value(const int index) |
|
326 | qreal QBoxSetPrivate::value(const int index) | |
321 | { |
|
327 | { | |
322 | if (index < 0 || index >= m_valuesCount) |
|
328 | if (index < 0 || index >= m_valuesCount) | |
323 | return 0; |
|
329 | return 0; | |
324 | return m_values[index]; |
|
330 | return m_values[index]; | |
325 | } |
|
331 | } | |
326 |
|
332 | |||
327 | #include "moc_qboxset.cpp" |
|
333 | #include "moc_qboxset.cpp" | |
328 | #include "moc_qboxset_p.cpp" |
|
334 | #include "moc_qboxset_p.cpp" | |
329 |
|
335 | |||
330 | QTCOMMERCIALCHART_END_NAMESPACE |
|
336 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,784 +1,789 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qpieslice.h" |
|
21 | #include "qpieslice.h" | |
22 | #include "qpieslice_p.h" |
|
22 | #include "qpieslice_p.h" | |
23 |
|
23 | |||
24 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
24 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
25 |
|
25 | |||
26 | /*! |
|
26 | /*! | |
27 | \class QPieSlice |
|
27 | \class QPieSlice | |
28 | \inmodule Qt Charts |
|
28 | \inmodule Qt Charts | |
29 | \brief Defines a slice in pie series. |
|
29 | \brief Defines a slice in pie series. | |
30 |
|
30 | |||
31 | This object defines the properties of a single slice in a QPieSeries. |
|
31 | This object defines the properties of a single slice in a QPieSeries. | |
32 |
|
32 | |||
33 | In addition to the obvious value and label properties the user can also control |
|
33 | In addition to the obvious value and label properties the user can also control | |
34 | the visual appearance of a slice. By modifying the visual appearance also means that |
|
34 | the visual appearance of a slice. By modifying the visual appearance also means that | |
35 | the user is overriding the default appearance set by the theme. |
|
35 | the user is overriding the default appearance set by the theme. | |
36 |
|
36 | |||
37 | Note that if the user has customized slices and theme is changed all customizations will be lost. |
|
37 | Note that if the user has customized slices and theme is changed all customizations will be lost. | |
38 |
|
38 | |||
39 | To enable user interaction with the pie some basic signals are provided about clicking and hovering. |
|
39 | To enable user interaction with the pie some basic signals are provided about clicking and hovering. | |
40 | */ |
|
40 | */ | |
41 |
|
41 | |||
42 | #ifdef QDOC_QT5 |
|
42 | #ifdef QDOC_QT5 | |
43 | /*! |
|
43 | /*! | |
44 | \qmltype PieSlice |
|
44 | \qmltype PieSlice | |
45 | \instantiates QPieSlice |
|
45 | \instantiates QPieSlice | |
46 | \inqmlmodule QtCommercial.Chart |
|
46 | \inqmlmodule QtCommercial.Chart | |
47 |
|
47 | |||
48 | \include doc/src/pieslice.qdocinc |
|
48 | \include doc/src/pieslice.qdocinc | |
49 | */ |
|
49 | */ | |
50 | #else |
|
50 | #else | |
51 | /*! |
|
51 | /*! | |
52 | \qmlclass PieSlice QPieSlice |
|
52 | \qmlclass PieSlice QPieSlice | |
53 |
|
53 | |||
54 | \include ../doc/src/pieslice.qdocinc |
|
54 | \include ../doc/src/pieslice.qdocinc | |
55 | */ |
|
55 | */ | |
56 | #endif |
|
56 | #endif | |
57 |
|
57 | |||
58 | /*! |
|
58 | /*! | |
59 | \enum QPieSlice::LabelPosition |
|
59 | \enum QPieSlice::LabelPosition | |
60 |
|
60 | |||
61 | This enum describes the position of the slice label. |
|
61 | This enum describes the position of the slice label. | |
62 |
|
62 | |||
63 | \value LabelOutside Label is outside the slice with an arm. |
|
63 | \value LabelOutside Label is outside the slice with an arm. | |
64 | \value LabelInsideHorizontal Label is centered inside the slice and laid out horizontally. |
|
64 | \value LabelInsideHorizontal Label is centered inside the slice and laid out horizontally. | |
65 | \value LabelInsideTangential Label is centered inside the slice and rotated to be parallel to the tangential of the slice's arc. |
|
65 | \value LabelInsideTangential Label is centered inside the slice and rotated to be parallel to the tangential of the slice's arc. | |
66 | \value LabelInsideNormal Label is centered inside the slice rotated to be parallel to the normal of the slice's arc. |
|
66 | \value LabelInsideNormal Label is centered inside the slice rotated to be parallel to the normal of the slice's arc. | |
67 | */ |
|
67 | */ | |
68 |
|
68 | |||
69 | /*! |
|
69 | /*! | |
70 | \property QPieSlice::label |
|
70 | \property QPieSlice::label | |
71 | Label of the slice. |
|
71 | Label of the slice. | |
72 | \sa labelVisible, labelBrush, labelFont, labelArmLengthFactor |
|
72 | \sa labelVisible, labelBrush, labelFont, labelArmLengthFactor | |
73 | */ |
|
73 | */ | |
74 | /*! |
|
74 | /*! | |
75 | \qmlproperty string PieSlice::label |
|
75 | \qmlproperty string PieSlice::label | |
76 | Label (text) of the slice. |
|
76 | Label (text) of the slice. | |
77 | */ |
|
77 | */ | |
78 |
|
78 | |||
79 | /*! |
|
79 | /*! | |
80 | \fn void QPieSlice::labelChanged() |
|
80 | \fn void QPieSlice::labelChanged() | |
81 | This signal emitted when the slice label has been changed. |
|
81 | This signal emitted when the slice label has been changed. | |
82 | \sa label |
|
82 | \sa label | |
83 | */ |
|
83 | */ | |
84 | /*! |
|
84 | /*! | |
85 | \qmlsignal PieSlice::onLabelChanged() |
|
85 | \qmlsignal PieSlice::onLabelChanged() | |
86 | This signal emitted when the slice label has been changed. |
|
86 | This signal emitted when the slice label has been changed. | |
87 | \sa label |
|
87 | \sa label | |
88 | */ |
|
88 | */ | |
89 |
|
89 | |||
90 | /*! |
|
90 | /*! | |
91 | \property QPieSlice::value |
|
91 | \property QPieSlice::value | |
92 | Value of the slice. |
|
92 | Value of the slice. | |
93 | Note that if users sets a negative value it is converted to a positive value. |
|
93 | Note that if users sets a negative value it is converted to a positive value. | |
94 | \sa percentage(), QPieSeries::sum() |
|
94 | \sa percentage(), QPieSeries::sum() | |
95 | */ |
|
95 | */ | |
96 | /*! |
|
96 | /*! | |
97 | \qmlproperty real PieSlice::value |
|
97 | \qmlproperty real PieSlice::value | |
98 | Value of the slice. Note that if users sets a negative value it is converted to a positive value. |
|
98 | Value of the slice. Note that if users sets a negative value it is converted to a positive value. | |
99 | */ |
|
99 | */ | |
100 |
|
100 | |||
101 | /*! |
|
101 | /*! | |
102 | \fn void QPieSlice::valueChanged() |
|
102 | \fn void QPieSlice::valueChanged() | |
103 | This signal is emitted when the slice value changes. |
|
103 | This signal is emitted when the slice value changes. | |
104 | \sa value |
|
104 | \sa value | |
105 | */ |
|
105 | */ | |
106 | /*! |
|
106 | /*! | |
107 | \qmlsignal PieSlice::onValueChanged() |
|
107 | \qmlsignal PieSlice::onValueChanged() | |
108 | This signal is emitted when the slice value changes. |
|
108 | This signal is emitted when the slice value changes. | |
109 | \sa value |
|
109 | \sa value | |
110 | */ |
|
110 | */ | |
111 |
|
111 | |||
112 | /*! |
|
112 | /*! | |
113 | \property QPieSlice::labelVisible |
|
113 | \property QPieSlice::labelVisible | |
114 | Defines the visibility of slice label. By default the label is not visible. |
|
114 | Defines the visibility of slice label. By default the label is not visible. | |
115 | \sa label, labelBrush, labelFont, labelArmLengthFactor |
|
115 | \sa label, labelBrush, labelFont, labelArmLengthFactor | |
116 | */ |
|
116 | */ | |
117 | /*! |
|
117 | /*! | |
118 | \qmlproperty bool PieSlice::labelVisible |
|
118 | \qmlproperty bool PieSlice::labelVisible | |
119 | Defines the visibility of slice label. By default the label is not visible. |
|
119 | Defines the visibility of slice label. By default the label is not visible. | |
120 | */ |
|
120 | */ | |
121 |
|
121 | |||
122 | /*! |
|
122 | /*! | |
123 | \fn void QPieSlice::labelVisibleChanged() |
|
123 | \fn void QPieSlice::labelVisibleChanged() | |
124 | This signal emitted when visibility of the slice label has changed. |
|
124 | This signal emitted when visibility of the slice label has changed. | |
125 | \sa labelVisible |
|
125 | \sa labelVisible | |
126 | */ |
|
126 | */ | |
127 | /*! |
|
127 | /*! | |
128 | \qmlsignal PieSlice::onLabelVisibleChanged() |
|
128 | \qmlsignal PieSlice::onLabelVisibleChanged() | |
129 | This signal emitted when visibility of the slice label has changed. |
|
129 | This signal emitted when visibility of the slice label has changed. | |
130 | \sa labelVisible |
|
130 | \sa labelVisible | |
131 | */ |
|
131 | */ | |
132 |
|
132 | |||
133 | /*! |
|
133 | /*! | |
134 | \property QPieSlice::exploded |
|
134 | \property QPieSlice::exploded | |
135 | If set to true the slice is "exploded" away from the pie. |
|
135 | If set to true the slice is "exploded" away from the pie. | |
136 | \sa explodeDistanceFactor |
|
136 | \sa explodeDistanceFactor | |
137 | */ |
|
137 | */ | |
138 | /*! |
|
138 | /*! | |
139 | \qmlproperty bool PieSlice::exploded |
|
139 | \qmlproperty bool PieSlice::exploded | |
140 | If set to true the slice is "exploded" away from the pie. |
|
140 | If set to true the slice is "exploded" away from the pie. | |
141 | \sa explodeDistanceFactor |
|
141 | \sa explodeDistanceFactor | |
142 | */ |
|
142 | */ | |
143 |
|
143 | |||
144 | /*! |
|
144 | /*! | |
145 | \property QPieSlice::pen |
|
145 | \property QPieSlice::pen | |
146 | Pen used to draw the slice border. |
|
146 | Pen used to draw the slice border. | |
147 | */ |
|
147 | */ | |
148 |
|
148 | |||
149 | /*! |
|
149 | /*! | |
150 | \fn void QPieSlice::penChanged() |
|
150 | \fn void QPieSlice::penChanged() | |
151 | This signal is emitted when the pen of the slice has changed. |
|
151 | This signal is emitted when the pen of the slice has changed. | |
152 | \sa pen |
|
152 | \sa pen | |
153 | */ |
|
153 | */ | |
154 |
|
154 | |||
155 | /*! |
|
155 | /*! | |
156 | \property QPieSlice::borderColor |
|
156 | \property QPieSlice::borderColor | |
157 | Color used to draw the slice border. |
|
157 | Color used to draw the slice border. | |
158 | This is a convenience property for modifying the slice pen. |
|
158 | This is a convenience property for modifying the slice pen. | |
159 | \sa pen, borderWidth |
|
159 | \sa pen, borderWidth | |
160 | */ |
|
160 | */ | |
161 | /*! |
|
161 | /*! | |
162 | \qmlproperty color PieSlice::borderColor |
|
162 | \qmlproperty color PieSlice::borderColor | |
163 | Color used to draw the slice border (pen color). |
|
163 | Color used to draw the slice border (pen color). | |
164 | \sa borderWidth |
|
164 | \sa borderWidth | |
165 | */ |
|
165 | */ | |
166 |
|
166 | |||
167 | /*! |
|
167 | /*! | |
168 | \fn void QPieSlice::borderColorChanged() |
|
168 | \fn void QPieSlice::borderColorChanged() | |
169 | This signal is emitted when slice border color changes. |
|
169 | This signal is emitted when slice border color changes. | |
170 | \sa pen, borderColor |
|
170 | \sa pen, borderColor | |
171 | */ |
|
171 | */ | |
172 | /*! |
|
172 | /*! | |
173 | \qmlsignal PieSlice::onBorderColorChanged() |
|
173 | \qmlsignal PieSlice::onBorderColorChanged() | |
174 | This signal is emitted when slice border color changes. |
|
174 | This signal is emitted when slice border color changes. | |
175 | \sa borderColor |
|
175 | \sa borderColor | |
176 | */ |
|
176 | */ | |
177 |
|
177 | |||
178 | /*! |
|
178 | /*! | |
179 | \property QPieSlice::borderWidth |
|
179 | \property QPieSlice::borderWidth | |
180 | Width of the slice border. |
|
180 | Width of the slice border. | |
181 | This is a convenience property for modifying the slice pen. |
|
181 | This is a convenience property for modifying the slice pen. | |
182 | \sa pen, borderColor |
|
182 | \sa pen, borderColor | |
183 | */ |
|
183 | */ | |
184 | /*! |
|
184 | /*! | |
185 | \qmlproperty int PieSlice::borderWidth |
|
185 | \qmlproperty int PieSlice::borderWidth | |
186 | Width of the slice border. |
|
186 | Width of the slice border. | |
187 | This is a convenience property for modifying the slice pen. |
|
187 | This is a convenience property for modifying the slice pen. | |
188 | \sa borderColor |
|
188 | \sa borderColor | |
189 | */ |
|
189 | */ | |
190 |
|
190 | |||
191 | /*! |
|
191 | /*! | |
192 | \fn void QPieSlice::borderWidthChanged() |
|
192 | \fn void QPieSlice::borderWidthChanged() | |
193 | This signal is emitted when slice border width changes. |
|
193 | This signal is emitted when slice border width changes. | |
194 | \sa pen, borderWidth |
|
194 | \sa pen, borderWidth | |
195 | */ |
|
195 | */ | |
196 | /*! |
|
196 | /*! | |
197 | \qmlsignal PieSlice::onBorderWidthChanged() |
|
197 | \qmlsignal PieSlice::onBorderWidthChanged() | |
198 | This signal is emitted when slice border width changes. |
|
198 | This signal is emitted when slice border width changes. | |
199 | \sa borderWidth |
|
199 | \sa borderWidth | |
200 | */ |
|
200 | */ | |
201 |
|
201 | |||
202 | /*! |
|
202 | /*! | |
203 | \property QPieSlice::brush |
|
203 | \property QPieSlice::brush | |
204 | Brush used to draw the slice. |
|
204 | Brush used to draw the slice. | |
205 | */ |
|
205 | */ | |
206 |
|
206 | |||
207 | /*! |
|
207 | /*! | |
208 | \fn void QPieSlice::brushChanged() |
|
208 | \fn void QPieSlice::brushChanged() | |
209 | This signal is emitted when the brush of the slice has changed. |
|
209 | This signal is emitted when the brush of the slice has changed. | |
210 | \sa brush |
|
210 | \sa brush | |
211 | */ |
|
211 | */ | |
212 |
|
212 | |||
213 | /*! |
|
213 | /*! | |
|
214 | \qmlproperty QString PieSlice::brushFilename | |||
|
215 | The name of the file used as a brush for the slice. | |||
|
216 | */ | |||
|
217 | ||||
|
218 | /*! | |||
214 | \property QPieSlice::color |
|
219 | \property QPieSlice::color | |
215 | Fill (brush) color of the slice. |
|
220 | Fill (brush) color of the slice. | |
216 | This is a convenience property for modifying the slice brush. |
|
221 | This is a convenience property for modifying the slice brush. | |
217 | \sa brush |
|
222 | \sa brush | |
218 | */ |
|
223 | */ | |
219 | /*! |
|
224 | /*! | |
220 | \qmlproperty color PieSlice::color |
|
225 | \qmlproperty color PieSlice::color | |
221 | Fill (brush) color of the slice. |
|
226 | Fill (brush) color of the slice. | |
222 | */ |
|
227 | */ | |
223 |
|
228 | |||
224 | /*! |
|
229 | /*! | |
225 | \fn void QPieSlice::colorChanged() |
|
230 | \fn void QPieSlice::colorChanged() | |
226 | This signal is emitted when slice color changes. |
|
231 | This signal is emitted when slice color changes. | |
227 | \sa brush |
|
232 | \sa brush | |
228 | */ |
|
233 | */ | |
229 | /*! |
|
234 | /*! | |
230 | \qmlsignal PieSlice::onColorChanged() |
|
235 | \qmlsignal PieSlice::onColorChanged() | |
231 | This signal is emitted when slice color changes. |
|
236 | This signal is emitted when slice color changes. | |
232 | */ |
|
237 | */ | |
233 |
|
238 | |||
234 | /*! |
|
239 | /*! | |
235 | \property QPieSlice::labelBrush |
|
240 | \property QPieSlice::labelBrush | |
236 | Brush used to draw label and label arm of the slice. |
|
241 | Brush used to draw label and label arm of the slice. | |
237 | \sa label, labelVisible, labelFont, labelArmLengthFactor |
|
242 | \sa label, labelVisible, labelFont, labelArmLengthFactor | |
238 | */ |
|
243 | */ | |
239 |
|
244 | |||
240 | /*! |
|
245 | /*! | |
241 | \fn void QPieSlice::labelBrushChanged() |
|
246 | \fn void QPieSlice::labelBrushChanged() | |
242 | This signal is emitted when the label brush of the slice has changed. |
|
247 | This signal is emitted when the label brush of the slice has changed. | |
243 | \sa labelBrush |
|
248 | \sa labelBrush | |
244 | */ |
|
249 | */ | |
245 |
|
250 | |||
246 | /*! |
|
251 | /*! | |
247 | \property QPieSlice::labelColor |
|
252 | \property QPieSlice::labelColor | |
248 | Color used to draw the slice label. |
|
253 | Color used to draw the slice label. | |
249 | This is a convenience property for modifying the slice label brush. |
|
254 | This is a convenience property for modifying the slice label brush. | |
250 | \sa labelBrush |
|
255 | \sa labelBrush | |
251 | */ |
|
256 | */ | |
252 | /*! |
|
257 | /*! | |
253 | \qmlproperty color PieSlice::labelColor |
|
258 | \qmlproperty color PieSlice::labelColor | |
254 | Color used to draw the slice label. |
|
259 | Color used to draw the slice label. | |
255 | */ |
|
260 | */ | |
256 |
|
261 | |||
257 | /*! |
|
262 | /*! | |
258 | \fn void QPieSlice::labelColorChanged() |
|
263 | \fn void QPieSlice::labelColorChanged() | |
259 | This signal is emitted when slice label color changes. |
|
264 | This signal is emitted when slice label color changes. | |
260 | \sa labelColor |
|
265 | \sa labelColor | |
261 | */ |
|
266 | */ | |
262 | /*! |
|
267 | /*! | |
263 | \qmlsignal PieSlice::onLabelColorChanged() |
|
268 | \qmlsignal PieSlice::onLabelColorChanged() | |
264 | This signal is emitted when slice label color changes. |
|
269 | This signal is emitted when slice label color changes. | |
265 | \sa labelColor |
|
270 | \sa labelColor | |
266 | */ |
|
271 | */ | |
267 |
|
272 | |||
268 | /*! |
|
273 | /*! | |
269 | \property QPieSlice::labelFont |
|
274 | \property QPieSlice::labelFont | |
270 | Font used for drawing label text. |
|
275 | Font used for drawing label text. | |
271 | \sa label, labelVisible, labelArmLengthFactor |
|
276 | \sa label, labelVisible, labelArmLengthFactor | |
272 | */ |
|
277 | */ | |
273 |
|
278 | |||
274 | /*! |
|
279 | /*! | |
275 | \fn void QPieSlice::labelFontChanged() |
|
280 | \fn void QPieSlice::labelFontChanged() | |
276 | This signal is emitted when the label font of the slice has changed. |
|
281 | This signal is emitted when the label font of the slice has changed. | |
277 | \sa labelFont |
|
282 | \sa labelFont | |
278 | */ |
|
283 | */ | |
279 |
|
284 | |||
280 | /*! |
|
285 | /*! | |
281 | \qmlproperty Font PieSlice::labelFont |
|
286 | \qmlproperty Font PieSlice::labelFont | |
282 |
|
287 | |||
283 | Defines the font used for slice label. |
|
288 | Defines the font used for slice label. | |
284 |
|
289 | |||
285 | See the Qt documentation for more details of Font. |
|
290 | See the Qt documentation for more details of Font. | |
286 |
|
291 | |||
287 | \sa labelVisible, labelPosition |
|
292 | \sa labelVisible, labelPosition | |
288 | */ |
|
293 | */ | |
289 |
|
294 | |||
290 | /*! |
|
295 | /*! | |
291 | \property QPieSlice::labelPosition |
|
296 | \property QPieSlice::labelPosition | |
292 | Position of the slice label. |
|
297 | Position of the slice label. | |
293 | \sa label, labelVisible |
|
298 | \sa label, labelVisible | |
294 | */ |
|
299 | */ | |
295 | /*! |
|
300 | /*! | |
296 | \qmlproperty LabelPosition PieSlice::labelPosition |
|
301 | \qmlproperty LabelPosition PieSlice::labelPosition | |
297 | Position of the slice label. One of PieSlice.LabelOutside, PieSlice.LabelInsideHorizontal, |
|
302 | Position of the slice label. One of PieSlice.LabelOutside, PieSlice.LabelInsideHorizontal, | |
298 | PieSlice.LabelInsideTangential or PieSlice.LabelInsideNormal. By default the position is |
|
303 | PieSlice.LabelInsideTangential or PieSlice.LabelInsideNormal. By default the position is | |
299 | PieSlice.LabelOutside. |
|
304 | PieSlice.LabelOutside. | |
300 | \sa labelVisible |
|
305 | \sa labelVisible | |
301 | */ |
|
306 | */ | |
302 |
|
307 | |||
303 | /*! |
|
308 | /*! | |
304 | \property QPieSlice::labelArmLengthFactor |
|
309 | \property QPieSlice::labelArmLengthFactor | |
305 | Defines the length of the label arm. |
|
310 | Defines the length of the label arm. | |
306 | The factor is relative to pie radius. For example: |
|
311 | The factor is relative to pie radius. For example: | |
307 | 1.0 means the length is the same as the radius. |
|
312 | 1.0 means the length is the same as the radius. | |
308 | 0.5 means the length is half of the radius. |
|
313 | 0.5 means the length is half of the radius. | |
309 | By default the arm length is 0.15 |
|
314 | By default the arm length is 0.15 | |
310 | \sa label, labelVisible, labelBrush, labelFont |
|
315 | \sa label, labelVisible, labelBrush, labelFont | |
311 | */ |
|
316 | */ | |
312 | /*! |
|
317 | /*! | |
313 | \qmlproperty real PieSlice::labelArmLengthFactor |
|
318 | \qmlproperty real PieSlice::labelArmLengthFactor | |
314 | Defines the length of the label arm. |
|
319 | Defines the length of the label arm. | |
315 | The factor is relative to pie radius. For example: |
|
320 | The factor is relative to pie radius. For example: | |
316 | 1.0 means the length is the same as the radius. |
|
321 | 1.0 means the length is the same as the radius. | |
317 | 0.5 means the length is half of the radius. |
|
322 | 0.5 means the length is half of the radius. | |
318 | By default the arm length is 0.15 |
|
323 | By default the arm length is 0.15 | |
319 | \sa labelVisible |
|
324 | \sa labelVisible | |
320 | */ |
|
325 | */ | |
321 |
|
326 | |||
322 | /*! |
|
327 | /*! | |
323 | \property QPieSlice::explodeDistanceFactor |
|
328 | \property QPieSlice::explodeDistanceFactor | |
324 | When the slice is exploded this factor defines how far the slice is exploded away from the pie. |
|
329 | When the slice is exploded this factor defines how far the slice is exploded away from the pie. | |
325 | The factor is relative to pie radius. For example: |
|
330 | The factor is relative to pie radius. For example: | |
326 | 1.0 means the distance is the same as the radius. |
|
331 | 1.0 means the distance is the same as the radius. | |
327 | 0.5 means the distance is half of the radius. |
|
332 | 0.5 means the distance is half of the radius. | |
328 | By default the distance is is 0.15 |
|
333 | By default the distance is is 0.15 | |
329 | \sa exploded |
|
334 | \sa exploded | |
330 | */ |
|
335 | */ | |
331 | /*! |
|
336 | /*! | |
332 | \qmlproperty real PieSlice::explodeDistanceFactor |
|
337 | \qmlproperty real PieSlice::explodeDistanceFactor | |
333 | When the slice is exploded this factor defines how far the slice is exploded away from the pie. |
|
338 | When the slice is exploded this factor defines how far the slice is exploded away from the pie. | |
334 | The factor is relative to pie radius. For example: |
|
339 | The factor is relative to pie radius. For example: | |
335 | 1.0 means the distance is the same as the radius. |
|
340 | 1.0 means the distance is the same as the radius. | |
336 | 0.5 means the distance is half of the radius. |
|
341 | 0.5 means the distance is half of the radius. | |
337 | By default the distance is is 0.15 |
|
342 | By default the distance is is 0.15 | |
338 | \sa exploded |
|
343 | \sa exploded | |
339 | */ |
|
344 | */ | |
340 |
|
345 | |||
341 | /*! |
|
346 | /*! | |
342 | \property QPieSlice::percentage |
|
347 | \property QPieSlice::percentage | |
343 | Percentage of the slice compared to the sum of all slices in the series. |
|
348 | Percentage of the slice compared to the sum of all slices in the series. | |
344 | The actual value ranges from 0.0 to 1.0. |
|
349 | The actual value ranges from 0.0 to 1.0. | |
345 | Updated automatically once the slice is added to the series. |
|
350 | Updated automatically once the slice is added to the series. | |
346 | \sa value, QPieSeries::sum |
|
351 | \sa value, QPieSeries::sum | |
347 | */ |
|
352 | */ | |
348 | /*! |
|
353 | /*! | |
349 | \qmlproperty real PieSlice::percentage |
|
354 | \qmlproperty real PieSlice::percentage | |
350 | Percentage of the slice compared to the sum of all slices in the series. |
|
355 | Percentage of the slice compared to the sum of all slices in the series. | |
351 | The actual value ranges from 0.0 to 1.0. |
|
356 | The actual value ranges from 0.0 to 1.0. | |
352 | Updated automatically once the slice is added to the series. |
|
357 | Updated automatically once the slice is added to the series. | |
353 | */ |
|
358 | */ | |
354 |
|
359 | |||
355 | /*! |
|
360 | /*! | |
356 | \fn void QPieSlice::percentageChanged() |
|
361 | \fn void QPieSlice::percentageChanged() | |
357 | This signal is emitted when the percentage of the slice has changed. |
|
362 | This signal is emitted when the percentage of the slice has changed. | |
358 | \sa percentage |
|
363 | \sa percentage | |
359 | */ |
|
364 | */ | |
360 | /*! |
|
365 | /*! | |
361 | \qmlsignal void PieSlice::onPercentageChanged() |
|
366 | \qmlsignal void PieSlice::onPercentageChanged() | |
362 | This signal is emitted when the percentage of the slice has changed. |
|
367 | This signal is emitted when the percentage of the slice has changed. | |
363 | \sa percentage |
|
368 | \sa percentage | |
364 | */ |
|
369 | */ | |
365 |
|
370 | |||
366 | /*! |
|
371 | /*! | |
367 | \property QPieSlice::startAngle |
|
372 | \property QPieSlice::startAngle | |
368 | Defines the starting angle of this slice in the series it belongs to. |
|
373 | Defines the starting angle of this slice in the series it belongs to. | |
369 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. |
|
374 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. | |
370 | Updated automatically once the slice is added to the series. |
|
375 | Updated automatically once the slice is added to the series. | |
371 | */ |
|
376 | */ | |
372 | /*! |
|
377 | /*! | |
373 | \qmlproperty real PieSlice::startAngle |
|
378 | \qmlproperty real PieSlice::startAngle | |
374 | Defines the starting angle of this slice in the series it belongs to. |
|
379 | Defines the starting angle of this slice in the series it belongs to. | |
375 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. |
|
380 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. | |
376 | Updated automatically once the slice is added to the series. |
|
381 | Updated automatically once the slice is added to the series. | |
377 | */ |
|
382 | */ | |
378 |
|
383 | |||
379 | /*! |
|
384 | /*! | |
380 | \fn void QPieSlice::startAngleChanged() |
|
385 | \fn void QPieSlice::startAngleChanged() | |
381 | This signal is emitted when the starting angle f the slice has changed. |
|
386 | This signal is emitted when the starting angle f the slice has changed. | |
382 | \sa startAngle |
|
387 | \sa startAngle | |
383 | */ |
|
388 | */ | |
384 | /*! |
|
389 | /*! | |
385 | \qmlsignal PieSlice::onStartAngleChanged() |
|
390 | \qmlsignal PieSlice::onStartAngleChanged() | |
386 | This signal is emitted when the starting angle f the slice has changed. |
|
391 | This signal is emitted when the starting angle f the slice has changed. | |
387 | \sa startAngle |
|
392 | \sa startAngle | |
388 | */ |
|
393 | */ | |
389 |
|
394 | |||
390 | /*! |
|
395 | /*! | |
391 | \property QPieSlice::angleSpan |
|
396 | \property QPieSlice::angleSpan | |
392 | Span of the slice in degrees. |
|
397 | Span of the slice in degrees. | |
393 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. |
|
398 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. | |
394 | Updated automatically once the slice is added to the series. |
|
399 | Updated automatically once the slice is added to the series. | |
395 | */ |
|
400 | */ | |
396 | /*! |
|
401 | /*! | |
397 | \qmlproperty real PieSlice::angleSpan |
|
402 | \qmlproperty real PieSlice::angleSpan | |
398 | Span of the slice in degrees. |
|
403 | Span of the slice in degrees. | |
399 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. |
|
404 | Full pie is 360 degrees where 0 degrees is at 12 a'clock. | |
400 | Updated automatically once the slice is added to the series. |
|
405 | Updated automatically once the slice is added to the series. | |
401 | */ |
|
406 | */ | |
402 |
|
407 | |||
403 | /*! |
|
408 | /*! | |
404 | \fn void QPieSlice::angleSpanChanged() |
|
409 | \fn void QPieSlice::angleSpanChanged() | |
405 | This signal is emitted when the angle span of the slice has changed. |
|
410 | This signal is emitted when the angle span of the slice has changed. | |
406 | \sa angleSpan |
|
411 | \sa angleSpan | |
407 | */ |
|
412 | */ | |
408 | /*! |
|
413 | /*! | |
409 | \qmlsignal PieSlice::onAngleSpanChanged() |
|
414 | \qmlsignal PieSlice::onAngleSpanChanged() | |
410 | This signal is emitted when the angle span of the slice has changed. |
|
415 | This signal is emitted when the angle span of the slice has changed. | |
411 | \sa angleSpan |
|
416 | \sa angleSpan | |
412 | */ |
|
417 | */ | |
413 |
|
418 | |||
414 | /*! |
|
419 | /*! | |
415 | \fn void QPieSlice::clicked() |
|
420 | \fn void QPieSlice::clicked() | |
416 | This signal is emitted when user has clicked the slice. |
|
421 | This signal is emitted when user has clicked the slice. | |
417 | \sa QPieSeries::clicked() |
|
422 | \sa QPieSeries::clicked() | |
418 | */ |
|
423 | */ | |
419 | /*! |
|
424 | /*! | |
420 | \qmlsignal PieSlice::onClicked() |
|
425 | \qmlsignal PieSlice::onClicked() | |
421 | This signal is emitted when user has clicked the slice. |
|
426 | This signal is emitted when user has clicked the slice. | |
422 | */ |
|
427 | */ | |
423 |
|
428 | |||
424 | /*! |
|
429 | /*! | |
425 | \fn void QPieSlice::hovered(bool state) |
|
430 | \fn void QPieSlice::hovered(bool state) | |
426 | This signal is emitted when user has hovered over or away from the slice. |
|
431 | This signal is emitted when user has hovered over or away from the slice. | |
427 | \a state is true when user has hovered over the slice and false when hover has moved away from the slice. |
|
432 | \a state is true when user has hovered over the slice and false when hover has moved away from the slice. | |
428 | \sa QPieSeries::hovered() |
|
433 | \sa QPieSeries::hovered() | |
429 | */ |
|
434 | */ | |
430 | /*! |
|
435 | /*! | |
431 | \qmlsignal PieSlice::onHovered(bool state) |
|
436 | \qmlsignal PieSlice::onHovered(bool state) | |
432 | This signal is emitted when user has hovered over or away from the slice. |
|
437 | This signal is emitted when user has hovered over or away from the slice. | |
433 | \a state is true when user has hovered over the slice and false when hover has moved away from the slice. |
|
438 | \a state is true when user has hovered over the slice and false when hover has moved away from the slice. | |
434 | */ |
|
439 | */ | |
435 |
|
440 | |||
436 | /*! |
|
441 | /*! | |
437 | Constructs an empty slice with a \a parent. |
|
442 | Constructs an empty slice with a \a parent. | |
438 | \sa QPieSeries::append(), QPieSeries::insert() |
|
443 | \sa QPieSeries::append(), QPieSeries::insert() | |
439 | */ |
|
444 | */ | |
440 | QPieSlice::QPieSlice(QObject *parent) |
|
445 | QPieSlice::QPieSlice(QObject *parent) | |
441 | : QObject(parent), |
|
446 | : QObject(parent), | |
442 | d_ptr(new QPieSlicePrivate(this)) |
|
447 | d_ptr(new QPieSlicePrivate(this)) | |
443 | { |
|
448 | { | |
444 |
|
449 | |||
445 | } |
|
450 | } | |
446 |
|
451 | |||
447 | /*! |
|
452 | /*! | |
448 | Constructs an empty slice with given \a value, \a label and a \a parent. |
|
453 | Constructs an empty slice with given \a value, \a label and a \a parent. | |
449 | \sa QPieSeries::append(), QPieSeries::insert() |
|
454 | \sa QPieSeries::append(), QPieSeries::insert() | |
450 | */ |
|
455 | */ | |
451 | QPieSlice::QPieSlice(QString label, qreal value, QObject *parent) |
|
456 | QPieSlice::QPieSlice(QString label, qreal value, QObject *parent) | |
452 | : QObject(parent), |
|
457 | : QObject(parent), | |
453 | d_ptr(new QPieSlicePrivate(this)) |
|
458 | d_ptr(new QPieSlicePrivate(this)) | |
454 | { |
|
459 | { | |
455 | setValue(value); |
|
460 | setValue(value); | |
456 | setLabel(label); |
|
461 | setLabel(label); | |
457 | } |
|
462 | } | |
458 |
|
463 | |||
459 | /*! |
|
464 | /*! | |
460 | Destroys the slice. |
|
465 | Destroys the slice. | |
461 | User should not delete the slice if it has been added to the series. |
|
466 | User should not delete the slice if it has been added to the series. | |
462 | */ |
|
467 | */ | |
463 | QPieSlice::~QPieSlice() |
|
468 | QPieSlice::~QPieSlice() | |
464 | { |
|
469 | { | |
465 |
|
470 | |||
466 | } |
|
471 | } | |
467 |
|
472 | |||
468 | void QPieSlice::setLabel(QString label) |
|
473 | void QPieSlice::setLabel(QString label) | |
469 | { |
|
474 | { | |
470 | if (d_ptr->m_data.m_labelText != label) { |
|
475 | if (d_ptr->m_data.m_labelText != label) { | |
471 | d_ptr->m_data.m_labelText = label; |
|
476 | d_ptr->m_data.m_labelText = label; | |
472 | emit labelChanged(); |
|
477 | emit labelChanged(); | |
473 | } |
|
478 | } | |
474 | } |
|
479 | } | |
475 |
|
480 | |||
476 | QString QPieSlice::label() const |
|
481 | QString QPieSlice::label() const | |
477 | { |
|
482 | { | |
478 | return d_ptr->m_data.m_labelText; |
|
483 | return d_ptr->m_data.m_labelText; | |
479 | } |
|
484 | } | |
480 |
|
485 | |||
481 | void QPieSlice::setValue(qreal value) |
|
486 | void QPieSlice::setValue(qreal value) | |
482 | { |
|
487 | { | |
483 | value = qAbs(value); // negative values not allowed |
|
488 | value = qAbs(value); // negative values not allowed | |
484 | if (!qFuzzyCompare(d_ptr->m_data.m_value, value)) { |
|
489 | if (!qFuzzyCompare(d_ptr->m_data.m_value, value)) { | |
485 | d_ptr->m_data.m_value = value; |
|
490 | d_ptr->m_data.m_value = value; | |
486 | emit valueChanged(); |
|
491 | emit valueChanged(); | |
487 | } |
|
492 | } | |
488 | } |
|
493 | } | |
489 |
|
494 | |||
490 | qreal QPieSlice::value() const |
|
495 | qreal QPieSlice::value() const | |
491 | { |
|
496 | { | |
492 | return d_ptr->m_data.m_value; |
|
497 | return d_ptr->m_data.m_value; | |
493 | } |
|
498 | } | |
494 |
|
499 | |||
495 | void QPieSlice::setLabelVisible(bool visible) |
|
500 | void QPieSlice::setLabelVisible(bool visible) | |
496 | { |
|
501 | { | |
497 | if (d_ptr->m_data.m_isLabelVisible != visible) { |
|
502 | if (d_ptr->m_data.m_isLabelVisible != visible) { | |
498 | d_ptr->m_data.m_isLabelVisible = visible; |
|
503 | d_ptr->m_data.m_isLabelVisible = visible; | |
499 | emit labelVisibleChanged(); |
|
504 | emit labelVisibleChanged(); | |
500 | } |
|
505 | } | |
501 | } |
|
506 | } | |
502 |
|
507 | |||
503 | bool QPieSlice::isLabelVisible() const |
|
508 | bool QPieSlice::isLabelVisible() const | |
504 | { |
|
509 | { | |
505 | return d_ptr->m_data.m_isLabelVisible; |
|
510 | return d_ptr->m_data.m_isLabelVisible; | |
506 | } |
|
511 | } | |
507 |
|
512 | |||
508 | void QPieSlice::setExploded(bool exploded) |
|
513 | void QPieSlice::setExploded(bool exploded) | |
509 | { |
|
514 | { | |
510 | if (d_ptr->m_data.m_isExploded != exploded) { |
|
515 | if (d_ptr->m_data.m_isExploded != exploded) { | |
511 | d_ptr->m_data.m_isExploded = exploded; |
|
516 | d_ptr->m_data.m_isExploded = exploded; | |
512 | emit d_ptr->explodedChanged(); |
|
517 | emit d_ptr->explodedChanged(); | |
513 | } |
|
518 | } | |
514 | } |
|
519 | } | |
515 |
|
520 | |||
516 | QPieSlice::LabelPosition QPieSlice::labelPosition() |
|
521 | QPieSlice::LabelPosition QPieSlice::labelPosition() | |
517 | { |
|
522 | { | |
518 | return d_ptr->m_data.m_labelPosition; |
|
523 | return d_ptr->m_data.m_labelPosition; | |
519 | } |
|
524 | } | |
520 |
|
525 | |||
521 | void QPieSlice::setLabelPosition(LabelPosition position) |
|
526 | void QPieSlice::setLabelPosition(LabelPosition position) | |
522 | { |
|
527 | { | |
523 | if (d_ptr->m_data.m_labelPosition != position) { |
|
528 | if (d_ptr->m_data.m_labelPosition != position) { | |
524 | d_ptr->m_data.m_labelPosition = position; |
|
529 | d_ptr->m_data.m_labelPosition = position; | |
525 | emit d_ptr->labelPositionChanged(); |
|
530 | emit d_ptr->labelPositionChanged(); | |
526 | } |
|
531 | } | |
527 | } |
|
532 | } | |
528 |
|
533 | |||
529 | bool QPieSlice::isExploded() const |
|
534 | bool QPieSlice::isExploded() const | |
530 | { |
|
535 | { | |
531 | return d_ptr->m_data.m_isExploded; |
|
536 | return d_ptr->m_data.m_isExploded; | |
532 | } |
|
537 | } | |
533 |
|
538 | |||
534 | void QPieSlice::setPen(const QPen &pen) |
|
539 | void QPieSlice::setPen(const QPen &pen) | |
535 | { |
|
540 | { | |
536 | d_ptr->setPen(pen, false); |
|
541 | d_ptr->setPen(pen, false); | |
537 | } |
|
542 | } | |
538 |
|
543 | |||
539 | QPen QPieSlice::pen() const |
|
544 | QPen QPieSlice::pen() const | |
540 | { |
|
545 | { | |
541 | return d_ptr->m_data.m_slicePen; |
|
546 | return d_ptr->m_data.m_slicePen; | |
542 | } |
|
547 | } | |
543 |
|
548 | |||
544 | QColor QPieSlice::borderColor() |
|
549 | QColor QPieSlice::borderColor() | |
545 | { |
|
550 | { | |
546 | return pen().color(); |
|
551 | return pen().color(); | |
547 | } |
|
552 | } | |
548 |
|
553 | |||
549 | void QPieSlice::setBorderColor(QColor color) |
|
554 | void QPieSlice::setBorderColor(QColor color) | |
550 | { |
|
555 | { | |
551 | QPen p = pen(); |
|
556 | QPen p = pen(); | |
552 | if (color != p.color()) { |
|
557 | if (color != p.color()) { | |
553 | p.setColor(color); |
|
558 | p.setColor(color); | |
554 | setPen(p); |
|
559 | setPen(p); | |
555 | } |
|
560 | } | |
556 | } |
|
561 | } | |
557 |
|
562 | |||
558 | int QPieSlice::borderWidth() |
|
563 | int QPieSlice::borderWidth() | |
559 | { |
|
564 | { | |
560 | return pen().width(); |
|
565 | return pen().width(); | |
561 | } |
|
566 | } | |
562 |
|
567 | |||
563 | void QPieSlice::setBorderWidth(int width) |
|
568 | void QPieSlice::setBorderWidth(int width) | |
564 | { |
|
569 | { | |
565 | QPen p = pen(); |
|
570 | QPen p = pen(); | |
566 | if (width != p.width()) { |
|
571 | if (width != p.width()) { | |
567 | p.setWidth(width); |
|
572 | p.setWidth(width); | |
568 | setPen(p); |
|
573 | setPen(p); | |
569 | } |
|
574 | } | |
570 | } |
|
575 | } | |
571 |
|
576 | |||
572 | void QPieSlice::setBrush(const QBrush &brush) |
|
577 | void QPieSlice::setBrush(const QBrush &brush) | |
573 | { |
|
578 | { | |
574 | d_ptr->setBrush(brush, false); |
|
579 | d_ptr->setBrush(brush, false); | |
575 | } |
|
580 | } | |
576 |
|
581 | |||
577 | QBrush QPieSlice::brush() const |
|
582 | QBrush QPieSlice::brush() const | |
578 | { |
|
583 | { | |
579 | return d_ptr->m_data.m_sliceBrush; |
|
584 | return d_ptr->m_data.m_sliceBrush; | |
580 | } |
|
585 | } | |
581 |
|
586 | |||
582 | QColor QPieSlice::color() |
|
587 | QColor QPieSlice::color() | |
583 | { |
|
588 | { | |
584 | return brush().color(); |
|
589 | return brush().color(); | |
585 | } |
|
590 | } | |
586 |
|
591 | |||
587 | void QPieSlice::setColor(QColor color) |
|
592 | void QPieSlice::setColor(QColor color) | |
588 | { |
|
593 | { | |
589 | QBrush b = brush(); |
|
594 | QBrush b = brush(); | |
590 |
|
595 | |||
591 | if (b == QBrush()) |
|
596 | if (b == QBrush()) | |
592 | b.setStyle(Qt::SolidPattern); |
|
597 | b.setStyle(Qt::SolidPattern); | |
593 | b.setColor(color); |
|
598 | b.setColor(color); | |
594 | setBrush(b); |
|
599 | setBrush(b); | |
595 | } |
|
600 | } | |
596 |
|
601 | |||
597 | void QPieSlice::setLabelBrush(const QBrush &brush) |
|
602 | void QPieSlice::setLabelBrush(const QBrush &brush) | |
598 | { |
|
603 | { | |
599 | d_ptr->setLabelBrush(brush, false); |
|
604 | d_ptr->setLabelBrush(brush, false); | |
600 | } |
|
605 | } | |
601 |
|
606 | |||
602 | QBrush QPieSlice::labelBrush() const |
|
607 | QBrush QPieSlice::labelBrush() const | |
603 | { |
|
608 | { | |
604 | return d_ptr->m_data.m_labelBrush; |
|
609 | return d_ptr->m_data.m_labelBrush; | |
605 | } |
|
610 | } | |
606 |
|
611 | |||
607 | QColor QPieSlice::labelColor() |
|
612 | QColor QPieSlice::labelColor() | |
608 | { |
|
613 | { | |
609 | return labelBrush().color(); |
|
614 | return labelBrush().color(); | |
610 | } |
|
615 | } | |
611 |
|
616 | |||
612 | void QPieSlice::setLabelColor(QColor color) |
|
617 | void QPieSlice::setLabelColor(QColor color) | |
613 | { |
|
618 | { | |
614 | QBrush b = labelBrush(); |
|
619 | QBrush b = labelBrush(); | |
615 | if (color != b.color()) { |
|
620 | if (color != b.color()) { | |
616 | b.setColor(color); |
|
621 | b.setColor(color); | |
617 | setLabelBrush(b); |
|
622 | setLabelBrush(b); | |
618 | } |
|
623 | } | |
619 | } |
|
624 | } | |
620 |
|
625 | |||
621 | void QPieSlice::setLabelFont(const QFont &font) |
|
626 | void QPieSlice::setLabelFont(const QFont &font) | |
622 | { |
|
627 | { | |
623 | d_ptr->setLabelFont(font, false); |
|
628 | d_ptr->setLabelFont(font, false); | |
624 | } |
|
629 | } | |
625 |
|
630 | |||
626 | QFont QPieSlice::labelFont() const |
|
631 | QFont QPieSlice::labelFont() const | |
627 | { |
|
632 | { | |
628 | return d_ptr->m_data.m_labelFont; |
|
633 | return d_ptr->m_data.m_labelFont; | |
629 | } |
|
634 | } | |
630 |
|
635 | |||
631 | void QPieSlice::setLabelArmLengthFactor(qreal factor) |
|
636 | void QPieSlice::setLabelArmLengthFactor(qreal factor) | |
632 | { |
|
637 | { | |
633 | if (!qFuzzyCompare(d_ptr->m_data.m_labelArmLengthFactor, factor)) { |
|
638 | if (!qFuzzyCompare(d_ptr->m_data.m_labelArmLengthFactor, factor)) { | |
634 | d_ptr->m_data.m_labelArmLengthFactor = factor; |
|
639 | d_ptr->m_data.m_labelArmLengthFactor = factor; | |
635 | emit d_ptr->labelArmLengthFactorChanged(); |
|
640 | emit d_ptr->labelArmLengthFactorChanged(); | |
636 | } |
|
641 | } | |
637 | } |
|
642 | } | |
638 |
|
643 | |||
639 | qreal QPieSlice::labelArmLengthFactor() const |
|
644 | qreal QPieSlice::labelArmLengthFactor() const | |
640 | { |
|
645 | { | |
641 | return d_ptr->m_data.m_labelArmLengthFactor; |
|
646 | return d_ptr->m_data.m_labelArmLengthFactor; | |
642 | } |
|
647 | } | |
643 |
|
648 | |||
644 | void QPieSlice::setExplodeDistanceFactor(qreal factor) |
|
649 | void QPieSlice::setExplodeDistanceFactor(qreal factor) | |
645 | { |
|
650 | { | |
646 | if (!qFuzzyCompare(d_ptr->m_data.m_explodeDistanceFactor, factor)) { |
|
651 | if (!qFuzzyCompare(d_ptr->m_data.m_explodeDistanceFactor, factor)) { | |
647 | d_ptr->m_data.m_explodeDistanceFactor = factor; |
|
652 | d_ptr->m_data.m_explodeDistanceFactor = factor; | |
648 | emit d_ptr->explodeDistanceFactorChanged(); |
|
653 | emit d_ptr->explodeDistanceFactorChanged(); | |
649 | } |
|
654 | } | |
650 | } |
|
655 | } | |
651 |
|
656 | |||
652 | qreal QPieSlice::explodeDistanceFactor() const |
|
657 | qreal QPieSlice::explodeDistanceFactor() const | |
653 | { |
|
658 | { | |
654 | return d_ptr->m_data.m_explodeDistanceFactor; |
|
659 | return d_ptr->m_data.m_explodeDistanceFactor; | |
655 | } |
|
660 | } | |
656 |
|
661 | |||
657 | qreal QPieSlice::percentage() const |
|
662 | qreal QPieSlice::percentage() const | |
658 | { |
|
663 | { | |
659 | return d_ptr->m_data.m_percentage; |
|
664 | return d_ptr->m_data.m_percentage; | |
660 | } |
|
665 | } | |
661 |
|
666 | |||
662 | qreal QPieSlice::startAngle() const |
|
667 | qreal QPieSlice::startAngle() const | |
663 | { |
|
668 | { | |
664 | return d_ptr->m_data.m_startAngle; |
|
669 | return d_ptr->m_data.m_startAngle; | |
665 | } |
|
670 | } | |
666 |
|
671 | |||
667 | qreal QPieSlice::angleSpan() const |
|
672 | qreal QPieSlice::angleSpan() const | |
668 | { |
|
673 | { | |
669 | return d_ptr->m_data.m_angleSpan; |
|
674 | return d_ptr->m_data.m_angleSpan; | |
670 | } |
|
675 | } | |
671 |
|
676 | |||
672 | /*! |
|
677 | /*! | |
673 | Returns the series that this slice belongs to. |
|
678 | Returns the series that this slice belongs to. | |
674 |
|
679 | |||
675 | \sa QPieSeries::append() |
|
680 | \sa QPieSeries::append() | |
676 | */ |
|
681 | */ | |
677 | QPieSeries *QPieSlice::series() const |
|
682 | QPieSeries *QPieSlice::series() const | |
678 | { |
|
683 | { | |
679 | return d_ptr->m_series; |
|
684 | return d_ptr->m_series; | |
680 | } |
|
685 | } | |
681 |
|
686 | |||
682 | QPieSlicePrivate::QPieSlicePrivate(QPieSlice *parent) |
|
687 | QPieSlicePrivate::QPieSlicePrivate(QPieSlice *parent) | |
683 | : QObject(parent), |
|
688 | : QObject(parent), | |
684 | q_ptr(parent), |
|
689 | q_ptr(parent), | |
685 | m_series(0) |
|
690 | m_series(0) | |
686 | { |
|
691 | { | |
687 |
|
692 | |||
688 | } |
|
693 | } | |
689 |
|
694 | |||
690 | QPieSlicePrivate::~QPieSlicePrivate() |
|
695 | QPieSlicePrivate::~QPieSlicePrivate() | |
691 | { |
|
696 | { | |
692 |
|
697 | |||
693 | } |
|
698 | } | |
694 |
|
699 | |||
695 | QPieSlicePrivate *QPieSlicePrivate::fromSlice(QPieSlice *slice) |
|
700 | QPieSlicePrivate *QPieSlicePrivate::fromSlice(QPieSlice *slice) | |
696 | { |
|
701 | { | |
697 | return slice->d_func(); |
|
702 | return slice->d_func(); | |
698 | } |
|
703 | } | |
699 |
|
704 | |||
700 | void QPieSlicePrivate::setPen(const QPen &pen, bool themed) |
|
705 | void QPieSlicePrivate::setPen(const QPen &pen, bool themed) | |
701 | { |
|
706 | { | |
702 | if (m_data.m_slicePen != pen) { |
|
707 | if (m_data.m_slicePen != pen) { | |
703 |
|
708 | |||
704 | QPen oldPen = m_data.m_slicePen; |
|
709 | QPen oldPen = m_data.m_slicePen; | |
705 |
|
710 | |||
706 | m_data.m_slicePen = pen; |
|
711 | m_data.m_slicePen = pen; | |
707 | m_data.m_slicePen.setThemed(themed); |
|
712 | m_data.m_slicePen.setThemed(themed); | |
708 |
|
713 | |||
709 | emit q_ptr->penChanged(); |
|
714 | emit q_ptr->penChanged(); | |
710 | if (oldPen.color() != pen.color()) |
|
715 | if (oldPen.color() != pen.color()) | |
711 | emit q_ptr->borderColorChanged(); |
|
716 | emit q_ptr->borderColorChanged(); | |
712 | if (oldPen.width() != pen.width()) |
|
717 | if (oldPen.width() != pen.width()) | |
713 | emit q_ptr->borderWidthChanged(); |
|
718 | emit q_ptr->borderWidthChanged(); | |
714 | } |
|
719 | } | |
715 | } |
|
720 | } | |
716 |
|
721 | |||
717 | void QPieSlicePrivate::setBrush(const QBrush &brush, bool themed) |
|
722 | void QPieSlicePrivate::setBrush(const QBrush &brush, bool themed) | |
718 | { |
|
723 | { | |
719 | if (m_data.m_sliceBrush != brush) { |
|
724 | if (m_data.m_sliceBrush != brush) { | |
720 |
|
725 | |||
721 | QBrush oldBrush = m_data.m_sliceBrush; |
|
726 | QBrush oldBrush = m_data.m_sliceBrush; | |
722 |
|
727 | |||
723 | m_data.m_sliceBrush = brush; |
|
728 | m_data.m_sliceBrush = brush; | |
724 | m_data.m_sliceBrush.setThemed(themed); |
|
729 | m_data.m_sliceBrush.setThemed(themed); | |
725 |
|
730 | |||
726 | emit q_ptr->brushChanged(); |
|
731 | emit q_ptr->brushChanged(); | |
727 | if (oldBrush.color() != brush.color()) |
|
732 | if (oldBrush.color() != brush.color()) | |
728 | emit q_ptr->colorChanged(); |
|
733 | emit q_ptr->colorChanged(); | |
729 | } |
|
734 | } | |
730 | } |
|
735 | } | |
731 |
|
736 | |||
732 | void QPieSlicePrivate::setLabelBrush(const QBrush &brush, bool themed) |
|
737 | void QPieSlicePrivate::setLabelBrush(const QBrush &brush, bool themed) | |
733 | { |
|
738 | { | |
734 | if (m_data.m_labelBrush != brush) { |
|
739 | if (m_data.m_labelBrush != brush) { | |
735 |
|
740 | |||
736 | QBrush oldBrush = m_data.m_labelBrush; |
|
741 | QBrush oldBrush = m_data.m_labelBrush; | |
737 |
|
742 | |||
738 | m_data.m_labelBrush = brush; |
|
743 | m_data.m_labelBrush = brush; | |
739 | m_data.m_labelBrush.setThemed(themed); |
|
744 | m_data.m_labelBrush.setThemed(themed); | |
740 |
|
745 | |||
741 | emit q_ptr->labelBrushChanged(); |
|
746 | emit q_ptr->labelBrushChanged(); | |
742 | if (oldBrush.color() != brush.color()) |
|
747 | if (oldBrush.color() != brush.color()) | |
743 | emit q_ptr->labelColorChanged(); |
|
748 | emit q_ptr->labelColorChanged(); | |
744 | } |
|
749 | } | |
745 | } |
|
750 | } | |
746 |
|
751 | |||
747 | void QPieSlicePrivate::setLabelFont(const QFont &font, bool themed) |
|
752 | void QPieSlicePrivate::setLabelFont(const QFont &font, bool themed) | |
748 | { |
|
753 | { | |
749 | if (m_data.m_labelFont != font) { |
|
754 | if (m_data.m_labelFont != font) { | |
750 | m_data.m_labelFont = font; |
|
755 | m_data.m_labelFont = font; | |
751 | m_data.m_labelFont.setThemed(themed); |
|
756 | m_data.m_labelFont.setThemed(themed); | |
752 | emit q_ptr->labelFontChanged(); |
|
757 | emit q_ptr->labelFontChanged(); | |
753 | } |
|
758 | } | |
754 | } |
|
759 | } | |
755 |
|
760 | |||
756 | void QPieSlicePrivate::setPercentage(qreal percentage) |
|
761 | void QPieSlicePrivate::setPercentage(qreal percentage) | |
757 | { |
|
762 | { | |
758 | if (!qFuzzyCompare(m_data.m_percentage, percentage)) { |
|
763 | if (!qFuzzyCompare(m_data.m_percentage, percentage)) { | |
759 | m_data.m_percentage = percentage; |
|
764 | m_data.m_percentage = percentage; | |
760 | emit q_ptr->percentageChanged(); |
|
765 | emit q_ptr->percentageChanged(); | |
761 | } |
|
766 | } | |
762 | } |
|
767 | } | |
763 |
|
768 | |||
764 | void QPieSlicePrivate::setStartAngle(qreal angle) |
|
769 | void QPieSlicePrivate::setStartAngle(qreal angle) | |
765 | { |
|
770 | { | |
766 | if (!qFuzzyCompare(m_data.m_startAngle, angle)) { |
|
771 | if (!qFuzzyCompare(m_data.m_startAngle, angle)) { | |
767 | m_data.m_startAngle = angle; |
|
772 | m_data.m_startAngle = angle; | |
768 | emit q_ptr->startAngleChanged(); |
|
773 | emit q_ptr->startAngleChanged(); | |
769 | } |
|
774 | } | |
770 | } |
|
775 | } | |
771 |
|
776 | |||
772 | void QPieSlicePrivate::setAngleSpan(qreal span) |
|
777 | void QPieSlicePrivate::setAngleSpan(qreal span) | |
773 | { |
|
778 | { | |
774 | if (!qFuzzyCompare(m_data.m_angleSpan, span)) { |
|
779 | if (!qFuzzyCompare(m_data.m_angleSpan, span)) { | |
775 | m_data.m_angleSpan = span; |
|
780 | m_data.m_angleSpan = span; | |
776 | emit q_ptr->angleSpanChanged(); |
|
781 | emit q_ptr->angleSpanChanged(); | |
777 | } |
|
782 | } | |
778 | } |
|
783 | } | |
779 |
|
784 | |||
780 | QTCOMMERCIALCHART_END_NAMESPACE |
|
785 | QTCOMMERCIALCHART_END_NAMESPACE | |
781 |
|
786 | |||
782 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
787 | QTCOMMERCIALCHART_USE_NAMESPACE | |
783 | #include "moc_qpieslice.cpp" |
|
788 | #include "moc_qpieslice.cpp" | |
784 | #include "moc_qpieslice_p.cpp" |
|
789 | #include "moc_qpieslice_p.cpp" |
@@ -1,310 +1,329 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "qscatterseries.h" |
|
21 | #include "qscatterseries.h" | |
22 | #include "qscatterseries_p.h" |
|
22 | #include "qscatterseries_p.h" | |
23 | #include "scatterchartitem_p.h" |
|
23 | #include "scatterchartitem_p.h" | |
24 | #include "chartdataset_p.h" |
|
24 | #include "chartdataset_p.h" | |
25 | #include "charttheme_p.h" |
|
25 | #include "charttheme_p.h" | |
26 | #include "scatteranimation_p.h" |
|
26 | #include "scatteranimation_p.h" | |
27 | #include "qchart_p.h" |
|
27 | #include "qchart_p.h" | |
28 |
|
28 | |||
29 | /*! |
|
29 | /*! | |
30 | \class QScatterSeries |
|
30 | \class QScatterSeries | |
31 | \inmodule Qt Charts |
|
31 | \inmodule Qt Charts | |
32 | \brief The QScatterSeries class is used for making scatter charts. |
|
32 | \brief The QScatterSeries class is used for making scatter charts. | |
33 |
|
33 | |||
34 | \mainclass |
|
34 | \mainclass | |
35 |
|
35 | |||
36 | The scatter data is displayed as a collection of points on the chart. Each point determines the position on the horizontal axis |
|
36 | The scatter data is displayed as a collection of points on the chart. Each point determines the position on the horizontal axis | |
37 | and the vertical axis. |
|
37 | and the vertical axis. | |
38 |
|
38 | |||
39 | \image examples_scatterchart.png |
|
39 | \image examples_scatterchart.png | |
40 |
|
40 | |||
41 | Creating basic scatter chart is simple: |
|
41 | Creating basic scatter chart is simple: | |
42 | \code |
|
42 | \code | |
43 | QScatterSeries* series = new QScatterSeries(); |
|
43 | QScatterSeries* series = new QScatterSeries(); | |
44 | series->append(0, 6); |
|
44 | series->append(0, 6); | |
45 | series->append(2, 4); |
|
45 | series->append(2, 4); | |
46 | ... |
|
46 | ... | |
47 | chart->addSeries(series); |
|
47 | chart->addSeries(series); | |
48 | \endcode |
|
48 | \endcode | |
49 | */ |
|
49 | */ | |
50 | #ifdef QDOC_QT5 |
|
50 | #ifdef QDOC_QT5 | |
51 | /*! |
|
51 | /*! | |
52 | \qmltype ScatterSeries |
|
52 | \qmltype ScatterSeries | |
53 | \instantiates QScatterSeries |
|
53 | \instantiates QScatterSeries | |
54 | \inqmlmodule QtCommercial.Chart |
|
54 | \inqmlmodule QtCommercial.Chart | |
55 |
|
55 | |||
56 | \include doc/src/scatterseries.qdocinc |
|
56 | \include doc/src/scatterseries.qdocinc | |
57 | */ |
|
57 | */ | |
58 | #else |
|
58 | #else | |
59 | /*! |
|
59 | /*! | |
60 | \qmlclass ScatterSeries QScatterSeries |
|
60 | \qmlclass ScatterSeries QScatterSeries | |
61 |
|
61 | |||
62 | \include ../doc/src/scatterseries.qdocinc |
|
62 | \include ../doc/src/scatterseries.qdocinc | |
63 | */ |
|
63 | */ | |
64 | #endif |
|
64 | #endif | |
65 |
|
65 | |||
66 | /*! |
|
66 | /*! | |
67 | \enum QScatterSeries::MarkerShape |
|
67 | \enum QScatterSeries::MarkerShape | |
68 |
|
68 | |||
69 | This enum describes the shape used when rendering marker items. |
|
69 | This enum describes the shape used when rendering marker items. | |
70 |
|
70 | |||
71 | \value MarkerShapeCircle |
|
71 | \value MarkerShapeCircle | |
72 | \value MarkerShapeRectangle |
|
72 | \value MarkerShapeRectangle | |
73 | */ |
|
73 | */ | |
74 |
|
74 | |||
75 | /*! |
|
75 | /*! | |
|
76 | \property QScatterSeries::brush | |||
|
77 | Brush used to draw the series. | |||
|
78 | */ | |||
|
79 | ||||
|
80 | /*! | |||
76 | \property QScatterSeries::color |
|
81 | \property QScatterSeries::color | |
77 | Fill (brush) color of the series. This is a convenience property for modifying the color of brush. |
|
82 | Fill (brush) color of the series. This is a convenience property for modifying the color of brush. | |
78 | \sa QScatterSeries::brush() |
|
83 | \sa QScatterSeries::brush() | |
79 | */ |
|
84 | */ | |
80 |
|
85 | |||
81 | /*! |
|
86 | /*! | |
82 | \property QScatterSeries::borderColor |
|
87 | \property QScatterSeries::borderColor | |
83 | Line (pen) color of the series. This is a convenience property for modifying the color of pen. |
|
88 | Line (pen) color of the series. This is a convenience property for modifying the color of pen. | |
84 | \sa QScatterSeries::pen() |
|
89 | \sa QScatterSeries::pen() | |
85 | */ |
|
90 | */ | |
86 | /*! |
|
91 | /*! | |
87 | \qmlproperty color ScatterSeries::borderColor |
|
92 | \qmlproperty color ScatterSeries::borderColor | |
88 | Border (pen) color of the series. |
|
93 | Border (pen) color of the series. | |
89 | */ |
|
94 | */ | |
90 |
|
95 | |||
91 | /*! |
|
96 | /*! | |
92 | \qmlproperty real ScatterSeries::borderWidth |
|
97 | \qmlproperty real ScatterSeries::borderWidth | |
93 | The width of the border line. By default the width is 2.0. |
|
98 | The width of the border line. By default the width is 2.0. | |
94 | */ |
|
99 | */ | |
95 |
|
100 | |||
96 | /*! |
|
101 | /*! | |
97 | \property QScatterSeries::markerShape |
|
102 | \property QScatterSeries::markerShape | |
98 | Defines the shape of the marker used to draw the points in the series. The default shape is MarkerShapeCircle. |
|
103 | Defines the shape of the marker used to draw the points in the series. The default shape is MarkerShapeCircle. | |
99 | */ |
|
104 | */ | |
100 | /*! |
|
105 | /*! | |
101 | \qmlproperty MarkerShape ScatterSeries::markerShape |
|
106 | \qmlproperty MarkerShape ScatterSeries::markerShape | |
102 | Defines the shape of the marker used to draw the points in the series. One of ScatterSeries |
|
107 | Defines the shape of the marker used to draw the points in the series. One of ScatterSeries | |
103 | ScatterSeries.MarkerShapeCircle or ScatterSeries.MarkerShapeRectangle. |
|
108 | ScatterSeries.MarkerShapeCircle or ScatterSeries.MarkerShapeRectangle. | |
104 | The default shape is ScatterSeries.MarkerShapeCircle. |
|
109 | The default shape is ScatterSeries.MarkerShapeCircle. | |
105 | */ |
|
110 | */ | |
106 |
|
111 | |||
107 | /*! |
|
112 | /*! | |
108 | \property QScatterSeries::markerSize |
|
113 | \property QScatterSeries::markerSize | |
109 | Defines the size of the marker used to draw the points in the series. The default size is 15.0. |
|
114 | Defines the size of the marker used to draw the points in the series. The default size is 15.0. | |
110 | */ |
|
115 | */ | |
111 | /*! |
|
116 | /*! | |
112 | \qmlproperty real ScatterSeries::markerSize |
|
117 | \qmlproperty real ScatterSeries::markerSize | |
113 | Defines the size of the marker used to draw the points in the series. The default size is 15.0. |
|
118 | Defines the size of the marker used to draw the points in the series. The default size is 15.0. | |
114 | */ |
|
119 | */ | |
115 |
|
120 | |||
116 | /*! |
|
121 | /*! | |
|
122 | \qmlproperty QString ScatterSeries::brushFilename | |||
|
123 | The name of the file used as a brush for the series. | |||
|
124 | */ | |||
|
125 | ||||
|
126 | /*! | |||
117 | \fn void QScatterSeries::colorChanged(QColor color) |
|
127 | \fn void QScatterSeries::colorChanged(QColor color) | |
118 | Signal is emitted when the fill (brush) color has changed to \a color. |
|
128 | Signal is emitted when the fill (brush) color has changed to \a color. | |
119 | */ |
|
129 | */ | |
120 |
|
130 | |||
121 | /*! |
|
131 | /*! | |
122 | \fn void QScatterSeries::borderColorChanged(QColor color) |
|
132 | \fn void QScatterSeries::borderColorChanged(QColor color) | |
123 | Signal is emitted when the line (pen) color has changed to \a color. |
|
133 | Signal is emitted when the line (pen) color has changed to \a color. | |
124 | */ |
|
134 | */ | |
125 | /*! |
|
135 | /*! | |
126 | \qmlsignal ScatterSeries::borderColorChanged(color color) |
|
136 | \qmlsignal ScatterSeries::borderColorChanged(color color) | |
127 | Signal is emitted when the line (pen) color has changed to \a color. |
|
137 | Signal is emitted when the line (pen) color has changed to \a color. | |
128 | */ |
|
138 | */ | |
129 |
|
139 | |||
130 | /*! |
|
140 | /*! | |
131 | \fn QAbstractSeries::SeriesType QScatterSeries::type() const |
|
141 | \fn QAbstractSeries::SeriesType QScatterSeries::type() const | |
132 | Returns QAbstractSeries::SeriesTypeScatter. |
|
142 | Returns QAbstractSeries::SeriesTypeScatter. | |
133 | \sa QAbstractSeries, SeriesType |
|
143 | \sa QAbstractSeries, SeriesType | |
134 | */ |
|
144 | */ | |
135 |
|
145 | |||
136 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
146 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
137 |
|
147 | |||
138 | /*! |
|
148 | /*! | |
139 | Constructs a series object which is a child of \a parent. |
|
149 | Constructs a series object which is a child of \a parent. | |
140 | */ |
|
150 | */ | |
141 | QScatterSeries::QScatterSeries(QObject *parent) |
|
151 | QScatterSeries::QScatterSeries(QObject *parent) | |
142 | : QXYSeries(*new QScatterSeriesPrivate(this), parent) |
|
152 | : QXYSeries(*new QScatterSeriesPrivate(this), parent) | |
143 | { |
|
153 | { | |
144 | } |
|
154 | } | |
145 |
|
155 | |||
146 | /*! |
|
156 | /*! | |
147 | Destroys the object. Note that adding series to QChart transfers the ownership to the chart. |
|
157 | Destroys the object. Note that adding series to QChart transfers the ownership to the chart. | |
148 | */ |
|
158 | */ | |
149 | QScatterSeries::~QScatterSeries() |
|
159 | QScatterSeries::~QScatterSeries() | |
150 | { |
|
160 | { | |
151 | Q_D(QScatterSeries); |
|
161 | Q_D(QScatterSeries); | |
152 | if (d->m_chart) |
|
162 | if (d->m_chart) | |
153 | d->m_chart->removeSeries(this); |
|
163 | d->m_chart->removeSeries(this); | |
154 | } |
|
164 | } | |
155 |
|
165 | |||
156 | QAbstractSeries::SeriesType QScatterSeries::type() const |
|
166 | QAbstractSeries::SeriesType QScatterSeries::type() const | |
157 | { |
|
167 | { | |
158 | return QAbstractSeries::SeriesTypeScatter; |
|
168 | return QAbstractSeries::SeriesTypeScatter; | |
159 | } |
|
169 | } | |
160 |
|
170 | |||
161 | /*! |
|
171 | /*! | |
162 | Sets \a pen used for drawing points' border on the chart. If the pen is not defined, the |
|
172 | Sets \a pen used for drawing points' border on the chart. If the pen is not defined, the | |
163 | pen from chart theme is used. |
|
173 | pen from chart theme is used. | |
164 | \sa QChart::setTheme() |
|
174 | \sa QChart::setTheme() | |
165 | */ |
|
175 | */ | |
166 | void QScatterSeries::setPen(const QPen &pen) |
|
176 | void QScatterSeries::setPen(const QPen &pen) | |
167 | { |
|
177 | { | |
168 | Q_D(QXYSeries); |
|
178 | Q_D(QXYSeries); | |
169 | if (d->m_pen != pen) { |
|
179 | if (d->m_pen != pen) { | |
170 | bool emitColorChanged = d->m_pen.color() != pen.color(); |
|
180 | bool emitColorChanged = d->m_pen.color() != pen.color(); | |
171 | d->m_pen = pen; |
|
181 | d->m_pen = pen; | |
172 | emit d->updated(); |
|
182 | emit d->updated(); | |
173 | if (emitColorChanged) |
|
183 | if (emitColorChanged) | |
174 | emit borderColorChanged(pen.color()); |
|
184 | emit borderColorChanged(pen.color()); | |
175 | } |
|
185 | } | |
176 | } |
|
186 | } | |
177 |
|
187 | |||
178 | /*! |
|
188 | /*! | |
179 | Sets \a brush used for drawing points on the chart. If the brush is not defined, brush |
|
189 | Sets \a brush used for drawing points on the chart. If the brush is not defined, brush | |
180 | from chart theme setting is used. |
|
190 | from chart theme setting is used. | |
181 | \sa QChart::setTheme() |
|
191 | \sa QChart::setTheme() | |
182 | */ |
|
192 | */ | |
183 | void QScatterSeries::setBrush(const QBrush &brush) |
|
193 | void QScatterSeries::setBrush(const QBrush &brush) | |
184 | { |
|
194 | { | |
185 | Q_D(QScatterSeries); |
|
195 | Q_D(QScatterSeries); | |
186 | if (d->m_brush != brush) { |
|
196 | if (d->m_brush != brush) { | |
187 | bool emitColorChanged = d->m_brush.color() != brush.color(); |
|
197 | bool emitColorChanged = d->m_brush.color() != brush.color(); | |
188 | d->m_brush = brush; |
|
198 | d->m_brush = brush; | |
189 | emit d->updated(); |
|
199 | emit d->updated(); | |
190 | if (emitColorChanged) |
|
200 | if (emitColorChanged) | |
191 | emit colorChanged(brush.color()); |
|
201 | emit colorChanged(brush.color()); | |
192 | } |
|
202 | } | |
193 | } |
|
203 | } | |
194 |
|
204 | |||
|
205 | QBrush QScatterSeries::brush() const | |||
|
206 | { | |||
|
207 | Q_D(const QScatterSeries); | |||
|
208 | if (d->m_brush == QChartPrivate::defaultBrush()) | |||
|
209 | return QBrush(); | |||
|
210 | else | |||
|
211 | return d->m_brush; | |||
|
212 | } | |||
|
213 | ||||
195 | void QScatterSeries::setColor(const QColor &color) |
|
214 | void QScatterSeries::setColor(const QColor &color) | |
196 | { |
|
215 | { | |
197 | QBrush b = brush(); |
|
216 | QBrush b = brush(); | |
198 | if (b == QChartPrivate::defaultBrush()) |
|
217 | if (b == QChartPrivate::defaultBrush()) | |
199 | b = QBrush(); |
|
218 | b = QBrush(); | |
200 | if (b == QBrush()) |
|
219 | if (b == QBrush()) | |
201 | b.setStyle(Qt::SolidPattern); |
|
220 | b.setStyle(Qt::SolidPattern); | |
202 | b.setColor(color); |
|
221 | b.setColor(color); | |
203 | setBrush(b); |
|
222 | setBrush(b); | |
204 | } |
|
223 | } | |
205 |
|
224 | |||
206 | QColor QScatterSeries::color() const |
|
225 | QColor QScatterSeries::color() const | |
207 | { |
|
226 | { | |
208 | return brush().color(); |
|
227 | return brush().color(); | |
209 | } |
|
228 | } | |
210 |
|
229 | |||
211 | void QScatterSeries::setBorderColor(const QColor &color) |
|
230 | void QScatterSeries::setBorderColor(const QColor &color) | |
212 | { |
|
231 | { | |
213 | QPen p = pen(); |
|
232 | QPen p = pen(); | |
214 | if (p == QChartPrivate::defaultPen()) |
|
233 | if (p == QChartPrivate::defaultPen()) | |
215 | p = QPen(); |
|
234 | p = QPen(); | |
216 | p.setColor(color); |
|
235 | p.setColor(color); | |
217 | setPen(p); |
|
236 | setPen(p); | |
218 | } |
|
237 | } | |
219 |
|
238 | |||
220 | QColor QScatterSeries::borderColor() const |
|
239 | QColor QScatterSeries::borderColor() const | |
221 | { |
|
240 | { | |
222 | return pen().color(); |
|
241 | return pen().color(); | |
223 | } |
|
242 | } | |
224 |
|
243 | |||
225 | QScatterSeries::MarkerShape QScatterSeries::markerShape() const |
|
244 | QScatterSeries::MarkerShape QScatterSeries::markerShape() const | |
226 | { |
|
245 | { | |
227 | Q_D(const QScatterSeries); |
|
246 | Q_D(const QScatterSeries); | |
228 | return d->m_shape; |
|
247 | return d->m_shape; | |
229 | } |
|
248 | } | |
230 |
|
249 | |||
231 | void QScatterSeries::setMarkerShape(MarkerShape shape) |
|
250 | void QScatterSeries::setMarkerShape(MarkerShape shape) | |
232 | { |
|
251 | { | |
233 | Q_D(QScatterSeries); |
|
252 | Q_D(QScatterSeries); | |
234 | if (d->m_shape != shape) { |
|
253 | if (d->m_shape != shape) { | |
235 | d->m_shape = shape; |
|
254 | d->m_shape = shape; | |
236 | emit d->updated(); |
|
255 | emit d->updated(); | |
237 | } |
|
256 | } | |
238 | } |
|
257 | } | |
239 |
|
258 | |||
240 | qreal QScatterSeries::markerSize() const |
|
259 | qreal QScatterSeries::markerSize() const | |
241 | { |
|
260 | { | |
242 | Q_D(const QScatterSeries); |
|
261 | Q_D(const QScatterSeries); | |
243 | return d->m_size; |
|
262 | return d->m_size; | |
244 | } |
|
263 | } | |
245 |
|
264 | |||
246 | void QScatterSeries::setMarkerSize(qreal size) |
|
265 | void QScatterSeries::setMarkerSize(qreal size) | |
247 | { |
|
266 | { | |
248 | Q_D(QScatterSeries); |
|
267 | Q_D(QScatterSeries); | |
249 |
|
268 | |||
250 | if (!qFuzzyCompare(d->m_size, size)) { |
|
269 | if (!qFuzzyCompare(d->m_size, size)) { | |
251 | d->m_size = size; |
|
270 | d->m_size = size; | |
252 | emit d->updated(); |
|
271 | emit d->updated(); | |
253 | } |
|
272 | } | |
254 | } |
|
273 | } | |
255 |
|
274 | |||
256 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
275 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
257 |
|
276 | |||
258 | QScatterSeriesPrivate::QScatterSeriesPrivate(QScatterSeries *q) |
|
277 | QScatterSeriesPrivate::QScatterSeriesPrivate(QScatterSeries *q) | |
259 | : QXYSeriesPrivate(q), |
|
278 | : QXYSeriesPrivate(q), | |
260 | m_shape(QScatterSeries::MarkerShapeCircle), |
|
279 | m_shape(QScatterSeries::MarkerShapeCircle), | |
261 | m_size(15.0) |
|
280 | m_size(15.0) | |
262 | { |
|
281 | { | |
263 | } |
|
282 | } | |
264 |
|
283 | |||
265 | void QScatterSeriesPrivate::initializeGraphics(QGraphicsItem* parent) |
|
284 | void QScatterSeriesPrivate::initializeGraphics(QGraphicsItem* parent) | |
266 | { |
|
285 | { | |
267 | Q_Q(QScatterSeries); |
|
286 | Q_Q(QScatterSeries); | |
268 | ScatterChartItem *scatter = new ScatterChartItem(q,parent); |
|
287 | ScatterChartItem *scatter = new ScatterChartItem(q,parent); | |
269 | m_item.reset(scatter); |
|
288 | m_item.reset(scatter); | |
270 | QAbstractSeriesPrivate::initializeGraphics(parent); |
|
289 | QAbstractSeriesPrivate::initializeGraphics(parent); | |
271 | } |
|
290 | } | |
272 |
|
291 | |||
273 | void QScatterSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) |
|
292 | void QScatterSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) | |
274 | { |
|
293 | { | |
275 | Q_Q(QScatterSeries); |
|
294 | Q_Q(QScatterSeries); | |
276 | const QList<QColor> colors = theme->seriesColors(); |
|
295 | const QList<QColor> colors = theme->seriesColors(); | |
277 | const QList<QGradient> gradients = theme->seriesGradients(); |
|
296 | const QList<QGradient> gradients = theme->seriesGradients(); | |
278 |
|
297 | |||
279 | if (forced || QChartPrivate::defaultPen() == m_pen) { |
|
298 | if (forced || QChartPrivate::defaultPen() == m_pen) { | |
280 | QPen pen; |
|
299 | QPen pen; | |
281 | pen.setColor(ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.0)); |
|
300 | pen.setColor(ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.0)); | |
282 | pen.setWidthF(2); |
|
301 | pen.setWidthF(2); | |
283 | q->setPen(pen); |
|
302 | q->setPen(pen); | |
284 | } |
|
303 | } | |
285 |
|
304 | |||
286 | if (forced || QChartPrivate::defaultBrush() == m_brush) { |
|
305 | if (forced || QChartPrivate::defaultBrush() == m_brush) { | |
287 | QBrush brush(colors.at(index % colors.size())); |
|
306 | QBrush brush(colors.at(index % colors.size())); | |
288 | q->setBrush(brush); |
|
307 | q->setBrush(brush); | |
289 | } |
|
308 | } | |
290 | } |
|
309 | } | |
291 |
|
310 | |||
292 | void QScatterSeriesPrivate::initializeAnimations(QChart::AnimationOptions options) |
|
311 | void QScatterSeriesPrivate::initializeAnimations(QChart::AnimationOptions options) | |
293 | { |
|
312 | { | |
294 | ScatterChartItem *item = static_cast<ScatterChartItem *>(m_item.data()); |
|
313 | ScatterChartItem *item = static_cast<ScatterChartItem *>(m_item.data()); | |
295 | Q_ASSERT(item); |
|
314 | Q_ASSERT(item); | |
296 |
|
315 | |||
297 | if (item->animation()) |
|
316 | if (item->animation()) | |
298 | item->animation()->stopAndDestroyLater(); |
|
317 | item->animation()->stopAndDestroyLater(); | |
299 |
|
318 | |||
300 | if (options.testFlag(QChart::SeriesAnimations)) |
|
319 | if (options.testFlag(QChart::SeriesAnimations)) | |
301 | item->setAnimation(new ScatterAnimation(item)); |
|
320 | item->setAnimation(new ScatterAnimation(item)); | |
302 | else |
|
321 | else | |
303 | item->setAnimation(0); |
|
322 | item->setAnimation(0); | |
304 |
|
323 | |||
305 | QAbstractSeriesPrivate::initializeAnimations(options); |
|
324 | QAbstractSeriesPrivate::initializeAnimations(options); | |
306 | } |
|
325 | } | |
307 |
|
326 | |||
308 | #include "moc_qscatterseries.cpp" |
|
327 | #include "moc_qscatterseries.cpp" | |
309 |
|
328 | |||
310 | QTCOMMERCIALCHART_END_NAMESPACE |
|
329 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -1,73 +1,75 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QSCATTERSERIES_H |
|
21 | #ifndef QSCATTERSERIES_H | |
22 | #define QSCATTERSERIES_H |
|
22 | #define QSCATTERSERIES_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <qxyseries.h> |
|
25 | #include <qxyseries.h> | |
26 |
|
26 | |||
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
27 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
28 |
|
28 | |||
29 | class QScatterSeriesPrivate; |
|
29 | class QScatterSeriesPrivate; | |
30 |
|
30 | |||
31 | class QTCOMMERCIALCHART_EXPORT QScatterSeries : public QXYSeries |
|
31 | class QTCOMMERCIALCHART_EXPORT QScatterSeries : public QXYSeries | |
32 | { |
|
32 | { | |
33 | Q_OBJECT |
|
33 | Q_OBJECT | |
34 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
34 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | |
35 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) |
|
35 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) | |
36 | Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape) |
|
36 | Q_PROPERTY(MarkerShape markerShape READ markerShape WRITE setMarkerShape) | |
37 | Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize) |
|
37 | Q_PROPERTY(qreal markerSize READ markerSize WRITE setMarkerSize) | |
|
38 | Q_PROPERTY(QBrush brush READ brush WRITE setBrush) | |||
38 | Q_ENUMS(MarkerShape) |
|
39 | Q_ENUMS(MarkerShape) | |
39 |
|
40 | |||
40 | public: |
|
41 | public: | |
41 | enum MarkerShape { |
|
42 | enum MarkerShape { | |
42 | MarkerShapeCircle, |
|
43 | MarkerShapeCircle, | |
43 | MarkerShapeRectangle |
|
44 | MarkerShapeRectangle | |
44 | }; |
|
45 | }; | |
45 |
|
46 | |||
46 | public: |
|
47 | public: | |
47 | explicit QScatterSeries(QObject *parent = 0); |
|
48 | explicit QScatterSeries(QObject *parent = 0); | |
48 | ~QScatterSeries(); |
|
49 | ~QScatterSeries(); | |
49 | QAbstractSeries::SeriesType type() const; |
|
50 | QAbstractSeries::SeriesType type() const; | |
50 | void setPen(const QPen &pen); |
|
51 | void setPen(const QPen &pen); | |
51 | void setBrush(const QBrush &brush); |
|
52 | void setBrush(const QBrush &brush); | |
|
53 | QBrush brush() const; | |||
52 | void setColor(const QColor &color); |
|
54 | void setColor(const QColor &color); | |
53 | QColor color() const; |
|
55 | QColor color() const; | |
54 | void setBorderColor(const QColor &color); |
|
56 | void setBorderColor(const QColor &color); | |
55 | QColor borderColor() const; |
|
57 | QColor borderColor() const; | |
56 | MarkerShape markerShape() const; |
|
58 | MarkerShape markerShape() const; | |
57 | void setMarkerShape(MarkerShape shape); |
|
59 | void setMarkerShape(MarkerShape shape); | |
58 | qreal markerSize() const; |
|
60 | qreal markerSize() const; | |
59 | void setMarkerSize(qreal size); |
|
61 | void setMarkerSize(qreal size); | |
60 |
|
62 | |||
61 | Q_SIGNALS: |
|
63 | Q_SIGNALS: | |
62 | void colorChanged(QColor color); |
|
64 | void colorChanged(QColor color); | |
63 | void borderColorChanged(QColor color); |
|
65 | void borderColorChanged(QColor color); | |
64 |
|
66 | |||
65 | private: |
|
67 | private: | |
66 | Q_DECLARE_PRIVATE(QScatterSeries) |
|
68 | Q_DECLARE_PRIVATE(QScatterSeries) | |
67 | Q_DISABLE_COPY(QScatterSeries) |
|
69 | Q_DISABLE_COPY(QScatterSeries) | |
68 | friend class ScatterChartItem; |
|
70 | friend class ScatterChartItem; | |
69 | }; |
|
71 | }; | |
70 |
|
72 | |||
71 | QTCOMMERCIALCHART_END_NAMESPACE |
|
73 | QTCOMMERCIALCHART_END_NAMESPACE | |
72 |
|
74 | |||
73 | #endif // QSCATTERSERIES_H |
|
75 | #endif // QSCATTERSERIES_H |
@@ -1,107 +1,107 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest BarCategoryAxis" |
|
31 | name: "tst_qml-qtquicktest BarCategoryAxis" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_minMax() { |
|
34 | function test_minMax() { | |
35 | compare(barSeries1.axisX.min, "Jan", "AxisX min"); |
|
35 | compare(barSeries1.axisX.min, "Jan", "AxisX min"); | |
36 | compare(barSeries1.axisX.max, "Jun", "AxisX max"); |
|
36 | compare(barSeries1.axisX.max, "Jun", "AxisX max"); | |
37 | compare(barSeries1.axisY.min, 0, "AxisY min"); |
|
37 | compare(barSeries1.axisY.min, 0, "AxisY min"); | |
38 | compare(barSeries1.axisY.max, 10, "AxisY max"); |
|
38 | compare(barSeries1.axisY.max, 10, "AxisY max"); | |
39 | } |
|
39 | } | |
40 |
|
40 | |||
41 | function test_categories() { |
|
41 | function test_categories() { | |
42 | compare(barSeries1.axisX.count, 6, "AxisX count"); |
|
42 | compare(barSeries1.axisX.count, 6, "AxisX count"); | |
43 | categoriesCountChangedSpy.clear(); |
|
43 | categoriesCountChangedSpy.clear(); | |
44 | categoriesChangedSpy.clear(); |
|
44 | categoriesChangedSpy.clear(); | |
45 |
|
45 | |||
46 | // Replace categories |
|
46 | // Replace categories | |
47 | barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"]; |
|
47 | barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"]; | |
48 | compare(barSeries1.axisX.count, 4, "AxisX count"); |
|
48 | compare(barSeries1.axisX.count, 4, "AxisX count"); | |
49 | compare(categoriesCountChangedSpy.count, 1, "onCountChanged"); |
|
49 | compare(categoriesCountChangedSpy.count, 1, "onCountChanged"); | |
50 | compare(categoriesChangedSpy.count, 1, "onCategoriesChanged"); |
|
50 | compare(categoriesChangedSpy.count, 1, "onCategoriesChanged"); | |
51 |
|
51 | |||
52 | // Reset the original categories |
|
52 | // Reset the original categories | |
53 | barSeries1.axisX.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] |
|
53 | barSeries1.axisX.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] | |
54 | compare(barSeries1.axisX.count, 6, "AxisX count"); |
|
54 | compare(barSeries1.axisX.count, 6, "AxisX count"); | |
55 | compare(categoriesCountChangedSpy.count, 2, "onCountChanged"); |
|
55 | compare(categoriesCountChangedSpy.count, 2, "onCountChanged"); | |
56 | compare(categoriesChangedSpy.count, 2, "onCategoriesChanged"); |
|
56 | compare(categoriesChangedSpy.count, 2, "onCategoriesChanged"); | |
57 | } |
|
57 | } | |
58 |
|
58 | |||
59 | function test_minMaxChanged() { |
|
59 | function test_minMaxChanged() { | |
60 | axisY.min = -1; |
|
60 | axisY.min = -1; | |
61 | compare(minChangedSpy.count, 1, "onMinChanged"); |
|
61 | compare(minChangedSpy.count, 1, "onMinChanged"); | |
62 | compare(maxChangedSpy.count, 0, "onMaxChanged"); |
|
62 | compare(maxChangedSpy.count, 0, "onMaxChanged"); | |
63 | axisY.max = 12; |
|
63 | axisY.max = 12; | |
64 | compare(minChangedSpy.count, 1, "onMinChanged"); |
|
64 | compare(minChangedSpy.count, 1, "onMinChanged"); | |
65 | compare(maxChangedSpy.count, 1, "onMaxChanged"); |
|
65 | compare(maxChangedSpy.count, 1, "onMaxChanged"); | |
66 | } |
|
66 | } | |
67 | } |
|
67 | } | |
68 |
|
68 | |||
69 | ChartView { |
|
69 | ChartView { | |
70 | id: chartView |
|
70 | id: chartView | |
71 | anchors.fill: parent |
|
71 | anchors.fill: parent | |
72 |
|
72 | |||
73 | BarSeries { |
|
73 | BarSeries { | |
74 | id: barSeries1 |
|
74 | id: barSeries1 | |
75 | axisX: BarCategoryAxis { |
|
75 | axisX: BarCategoryAxis { | |
76 | id: axisX |
|
76 | id: axisX | |
77 | categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ] |
|
77 | categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ] | |
78 | } |
|
78 | } | |
79 | axisY: ValuesAxis { |
|
79 | axisY: ValuesAxis { | |
80 | id: axisY |
|
80 | id: axisY | |
81 | min: 0 |
|
81 | min: 0 | |
82 | max: 10 |
|
82 | max: 10 | |
83 | } |
|
83 | } | |
84 | } |
|
84 | } | |
85 |
|
85 | |||
86 | SignalSpy { |
|
86 | SignalSpy { | |
87 | id: categoriesCountChangedSpy |
|
87 | id: categoriesCountChangedSpy | |
88 | target: axisX |
|
88 | target: axisX | |
89 | signalName: "countChanged" |
|
89 | signalName: "countChanged" | |
90 | } |
|
90 | } | |
91 | SignalSpy { |
|
91 | SignalSpy { | |
92 | id: categoriesChangedSpy |
|
92 | id: categoriesChangedSpy | |
93 | target: axisX |
|
93 | target: axisX | |
94 | signalName: "categoriesChanged" |
|
94 | signalName: "categoriesChanged" | |
95 | } |
|
95 | } | |
96 | SignalSpy { |
|
96 | SignalSpy { | |
97 | id: minChangedSpy |
|
97 | id: minChangedSpy | |
98 | target: axisY |
|
98 | target: axisY | |
99 | signalName: "minChanged" |
|
99 | signalName: "minChanged" | |
100 | } |
|
100 | } | |
101 | SignalSpy { |
|
101 | SignalSpy { | |
102 | id: maxChangedSpy |
|
102 | id: maxChangedSpy | |
103 | target: axisY |
|
103 | target: axisY | |
104 | signalName: "maxChanged" |
|
104 | signalName: "maxChanged" | |
105 | } |
|
105 | } | |
106 | } |
|
106 | } | |
107 | } |
|
107 | } |
@@ -1,146 +1,151 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest BarSeries" |
|
31 | name: "tst_qml-qtquicktest BarSeries" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_properties() { |
|
34 | function test_properties() { | |
35 | compare(barSeries.barWidth, 0.5); |
|
35 | compare(barSeries.barWidth, 0.5); | |
36 | compare(barSeries.labelsVisible, false); |
|
36 | compare(barSeries.labelsVisible, false); | |
37 | } |
|
37 | } | |
38 |
|
38 | |||
|
39 | function test_setproperties() { | |||
|
40 | var set = barSeries.append("property", [1, 2, 3]) | |||
|
41 | compare(set.brushFilename, ""); | |||
|
42 | } | |||
|
43 | ||||
39 | function test_axes() { |
|
44 | function test_axes() { | |
40 | verify(chartView.axisX() == barSeries.axisX); |
|
45 | verify(chartView.axisX() == barSeries.axisX); | |
41 | verify(chartView.axisY() == barSeries.axisY); |
|
46 | verify(chartView.axisY() == barSeries.axisY); | |
42 |
|
47 | |||
43 | compare(barSeries.axisX, stackedBarSeries.axisX); |
|
48 | compare(barSeries.axisX, stackedBarSeries.axisX); | |
44 | compare(barSeries.axisY, stackedBarSeries.axisY); |
|
49 | compare(barSeries.axisY, stackedBarSeries.axisY); | |
45 |
|
50 | |||
46 | compare(barSeries.axisX, percentBarSeries.axisX); |
|
51 | compare(barSeries.axisX, percentBarSeries.axisX); | |
47 | compare(barSeries.axisY, percentBarSeries.axisY); |
|
52 | compare(barSeries.axisY, percentBarSeries.axisY); | |
48 | } |
|
53 | } | |
49 |
|
54 | |||
50 | function test_append() { |
|
55 | function test_append() { | |
51 | var setCount = 5; |
|
56 | var setCount = 5; | |
52 | var valueCount = 50; |
|
57 | var valueCount = 50; | |
53 | addedSpy.clear(); |
|
58 | addedSpy.clear(); | |
54 | append(setCount, valueCount); |
|
59 | append(setCount, valueCount); | |
55 |
|
60 | |||
56 | compare(barSeries.count, setCount); |
|
61 | compare(barSeries.count, setCount); | |
57 | for (var k = 0; k < setCount; k++) { |
|
62 | for (var k = 0; k < setCount; k++) { | |
58 | compare(barSeries.at(k).count, valueCount); |
|
63 | compare(barSeries.at(k).count, valueCount); | |
59 | compare(barSeries.at(k).label, "barset" + k); |
|
64 | compare(barSeries.at(k).label, "barset" + k); | |
60 | } |
|
65 | } | |
61 | compare(addedSpy.count, setCount); |
|
66 | compare(addedSpy.count, setCount); | |
62 |
|
67 | |||
63 | barSeries.clear(); |
|
68 | barSeries.clear(); | |
64 | compare(barSeries.count, 0); |
|
69 | compare(barSeries.count, 0); | |
65 | } |
|
70 | } | |
66 |
|
71 | |||
67 | function test_insert() { |
|
72 | function test_insert() { | |
68 | var setCount = 5; |
|
73 | var setCount = 5; | |
69 | var valueCount = 50; |
|
74 | var valueCount = 50; | |
70 | addedSpy.clear(); |
|
75 | addedSpy.clear(); | |
71 | append(setCount, valueCount); |
|
76 | append(setCount, valueCount); | |
72 |
|
77 | |||
73 | for (var i = 0; i < setCount; i++) { |
|
78 | for (var i = 0; i < setCount; i++) { | |
74 | var values = []; |
|
79 | var values = []; | |
75 | for (var j = 0; j < valueCount; j++) |
|
80 | for (var j = 0; j < valueCount; j++) | |
76 | values[j] = Math.random() * 10; |
|
81 | values[j] = Math.random() * 10; | |
77 | var set = barSeries.insert(i, "barset" + i, values); |
|
82 | var set = barSeries.insert(i, "barset" + i, values); | |
78 | compare(set.label, "barset" + i); |
|
83 | compare(set.label, "barset" + i); | |
79 | } |
|
84 | } | |
80 |
|
85 | |||
81 | compare(barSeries.count, setCount * 2); |
|
86 | compare(barSeries.count, setCount * 2); | |
82 | for (var k = 0; k < setCount * 2; k++) |
|
87 | for (var k = 0; k < setCount * 2; k++) | |
83 | compare(barSeries.at(k).count, valueCount); |
|
88 | compare(barSeries.at(k).count, valueCount); | |
84 | compare(addedSpy.count, 2 * setCount); |
|
89 | compare(addedSpy.count, 2 * setCount); | |
85 |
|
90 | |||
86 | barSeries.clear(); |
|
91 | barSeries.clear(); | |
87 | compare(barSeries.count, 0); |
|
92 | compare(barSeries.count, 0); | |
88 | } |
|
93 | } | |
89 |
|
94 | |||
90 | function test_remove() { |
|
95 | function test_remove() { | |
91 | var setCount = 5; |
|
96 | var setCount = 5; | |
92 | var valueCount = 50; |
|
97 | var valueCount = 50; | |
93 | removedSpy.clear(); |
|
98 | removedSpy.clear(); | |
94 | append(setCount, valueCount); |
|
99 | append(setCount, valueCount); | |
95 |
|
100 | |||
96 | for (var k = 0; k < setCount; k++) |
|
101 | for (var k = 0; k < setCount; k++) | |
97 | barSeries.remove(barSeries.at(0)); |
|
102 | barSeries.remove(barSeries.at(0)); | |
98 |
|
103 | |||
99 | compare(barSeries.count, 0); |
|
104 | compare(barSeries.count, 0); | |
100 | compare(removedSpy.count, setCount); |
|
105 | compare(removedSpy.count, setCount); | |
101 | } |
|
106 | } | |
102 |
|
107 | |||
103 | // Not a test function, used by one or more test functions |
|
108 | // Not a test function, used by one or more test functions | |
104 | function append(setCount, valueCount) { |
|
109 | function append(setCount, valueCount) { | |
105 | for (var i = 0; i < setCount; i++) { |
|
110 | for (var i = 0; i < setCount; i++) { | |
106 | var values = []; |
|
111 | var values = []; | |
107 | for (var j = 0; j < valueCount; j++) |
|
112 | for (var j = 0; j < valueCount; j++) | |
108 | values[j] = Math.random() * 10; |
|
113 | values[j] = Math.random() * 10; | |
109 | barSeries.append("barset" + i, values); |
|
114 | barSeries.append("barset" + i, values); | |
110 | } |
|
115 | } | |
111 | } |
|
116 | } | |
112 | } |
|
117 | } | |
113 |
|
118 | |||
114 | ChartView { |
|
119 | ChartView { | |
115 | id: chartView |
|
120 | id: chartView | |
116 | anchors.fill: parent |
|
121 | anchors.fill: parent | |
117 |
|
122 | |||
118 | BarSeries { |
|
123 | BarSeries { | |
119 | id: barSeries |
|
124 | id: barSeries | |
120 | name: "bar" |
|
125 | name: "bar" | |
121 | axisX: BarCategoryAxis {} |
|
126 | axisX: BarCategoryAxis {} | |
122 | axisY: ValueAxis { min: 0; max: 10 } |
|
127 | axisY: ValueAxis { min: 0; max: 10 } | |
123 |
|
128 | |||
124 | SignalSpy { |
|
129 | SignalSpy { | |
125 | id: addedSpy |
|
130 | id: addedSpy | |
126 | target: barSeries |
|
131 | target: barSeries | |
127 | signalName: "barsetsAdded" |
|
132 | signalName: "barsetsAdded" | |
128 | } |
|
133 | } | |
129 | SignalSpy { |
|
134 | SignalSpy { | |
130 | id: removedSpy |
|
135 | id: removedSpy | |
131 | target: barSeries |
|
136 | target: barSeries | |
132 | signalName: "barsetsRemoved" |
|
137 | signalName: "barsetsRemoved" | |
133 | } |
|
138 | } | |
134 | } |
|
139 | } | |
135 |
|
140 | |||
136 | StackedBarSeries { |
|
141 | StackedBarSeries { | |
137 | id: stackedBarSeries |
|
142 | id: stackedBarSeries | |
138 | name: "stackedBar" |
|
143 | name: "stackedBar" | |
139 | } |
|
144 | } | |
140 |
|
145 | |||
141 | PercentBarSeries { |
|
146 | PercentBarSeries { | |
142 | id: percentBarSeries |
|
147 | id: percentBarSeries | |
143 | name: "percentBar" |
|
148 | name: "percentBar" | |
144 | } |
|
149 | } | |
145 | } |
|
150 | } | |
146 | } |
|
151 | } |
@@ -1,96 +1,98 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest BoxPlotSeries" |
|
31 | name: "tst_qml-qtquicktest BoxPlotSeries" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_properties() { |
|
34 | function test_properties() { | |
35 | compare(boxPlotSeries.boxWidth, 0.5); |
|
35 | compare(boxPlotSeries.boxWidth, 0.5); | |
|
36 | compare(boxPlotSeries.brushFilename, ""); | |||
36 | } |
|
37 | } | |
37 |
|
38 | |||
38 | function test_setproperties() { |
|
39 | function test_setproperties() { | |
39 | var set = boxPlotSeries.append("boxplot", [1, 2, 5, 6, 8]); |
|
40 | var set = boxPlotSeries.append("boxplot", [1, 2, 5, 6, 8]); | |
40 | compare(set.label, "boxplot"); |
|
41 | compare(set.label, "boxplot"); | |
41 | compare(set.count, 5); |
|
42 | compare(set.count, 5); | |
|
43 | compare(set.brushFilename, ""); | |||
42 | } |
|
44 | } | |
43 |
|
45 | |||
44 | function test_append() { |
|
46 | function test_append() { | |
45 | addedSpy.clear(); |
|
47 | addedSpy.clear(); | |
46 | countChangedSpy.clear(); |
|
48 | countChangedSpy.clear(); | |
47 | var count = 50; |
|
49 | var count = 50; | |
48 | for (var i = 0; i < count; i++) |
|
50 | for (var i = 0; i < count; i++) | |
49 | boxPlotSeries.append("boxplot" + i, Math.random()); |
|
51 | boxPlotSeries.append("boxplot" + i, Math.random()); | |
50 | compare(addedSpy.count, count); |
|
52 | compare(addedSpy.count, count); | |
51 | compare(countChangedSpy.count, count); |
|
53 | compare(countChangedSpy.count, count); | |
52 | console.log("Check the series count once QTRD-2504 is implemented"); |
|
54 | console.log("Check the series count once QTRD-2504 is implemented"); | |
53 | boxPlotSeries.clear(); |
|
55 | boxPlotSeries.clear(); | |
54 | } |
|
56 | } | |
55 |
|
57 | |||
56 | function test_remove() { |
|
58 | function test_remove() { | |
57 | removedSpy.clear(); |
|
59 | removedSpy.clear(); | |
58 | countChangedSpy.clear(); |
|
60 | countChangedSpy.clear(); | |
59 | var count = 50; |
|
61 | var count = 50; | |
60 | for (var i = 0; i < count; i++) |
|
62 | for (var i = 0; i < count; i++) | |
61 | boxPlotSeries.append("boxplot" + i, Math.random()); |
|
63 | boxPlotSeries.append("boxplot" + i, Math.random()); | |
62 | for (var j = 0; j < count; j++) |
|
64 | for (var j = 0; j < count; j++) | |
63 | boxPlotSeries.remove(boxPlotSeries.at(0)); |
|
65 | boxPlotSeries.remove(boxPlotSeries.at(0)); | |
64 | compare(removedSpy.count, count); |
|
66 | compare(removedSpy.count, count); | |
65 | compare(countChangedSpy.count, 2 * count); |
|
67 | compare(countChangedSpy.count, 2 * count); | |
66 | console.log("Check the series count once QTRD-2504 is implemented"); |
|
68 | console.log("Check the series count once QTRD-2504 is implemented"); | |
67 | } |
|
69 | } | |
68 | } |
|
70 | } | |
69 |
|
71 | |||
70 | ChartView { |
|
72 | ChartView { | |
71 | id: chartView |
|
73 | id: chartView | |
72 | anchors.fill: parent |
|
74 | anchors.fill: parent | |
73 |
|
75 | |||
74 | BoxPlotSeries { |
|
76 | BoxPlotSeries { | |
75 | id: boxPlotSeries |
|
77 | id: boxPlotSeries | |
76 | name: "boxplot" |
|
78 | name: "boxplot" | |
77 | BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] } |
|
79 | BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] } | |
78 |
|
80 | |||
79 | SignalSpy { |
|
81 | SignalSpy { | |
80 | id: addedSpy |
|
82 | id: addedSpy | |
81 | target: boxPlotSeries |
|
83 | target: boxPlotSeries | |
82 | signalName: "boxsetsAdded" |
|
84 | signalName: "boxsetsAdded" | |
83 | } |
|
85 | } | |
84 | SignalSpy { |
|
86 | SignalSpy { | |
85 | id: removedSpy |
|
87 | id: removedSpy | |
86 | target: boxPlotSeries |
|
88 | target: boxPlotSeries | |
87 | signalName: "boxsetsRemoved" |
|
89 | signalName: "boxsetsRemoved" | |
88 | } |
|
90 | } | |
89 | SignalSpy { |
|
91 | SignalSpy { | |
90 | id: countChangedSpy |
|
92 | id: countChangedSpy | |
91 | target: boxPlotSeries |
|
93 | target: boxPlotSeries | |
92 | signalName: "countChanged" |
|
94 | signalName: "countChanged" | |
93 | } |
|
95 | } | |
94 | } |
|
96 | } | |
95 | } |
|
97 | } | |
96 | } |
|
98 | } |
@@ -1,84 +1,84 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest CategoryAxis" |
|
31 | name: "tst_qml-qtquicktest CategoryAxis" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_minMax() { |
|
34 | function test_minMax() { | |
35 | compare(lineSeries1.axisX.min, 0, "AxisX min"); |
|
35 | compare(lineSeries1.axisX.min, 0, "AxisX min"); | |
36 | compare(lineSeries1.axisX.max, 10, "AxisX max"); |
|
36 | compare(lineSeries1.axisX.max, 10, "AxisX max"); | |
37 | compare(lineSeries1.axisY.min, 0, "AxisY min"); |
|
37 | compare(lineSeries1.axisY.min, 0, "AxisY min"); | |
38 | compare(lineSeries1.axisY.max, 10, "AxisY max"); |
|
38 | compare(lineSeries1.axisY.max, 10, "AxisY max"); | |
39 | } |
|
39 | } | |
40 |
|
40 | |||
41 | function test_categories() { |
|
41 | function test_categories() { | |
42 | compare(lineSeries1.axisY.startValue, 0, "AxisY start value"); |
|
42 | compare(lineSeries1.axisY.startValue, 0, "AxisY start value"); | |
43 | compare(lineSeries1.axisY.count, 3, "AxisY count"); |
|
43 | compare(lineSeries1.axisY.count, 3, "AxisY count"); | |
44 | compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels"); |
|
44 | compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels"); | |
45 | compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels"); |
|
45 | compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels"); | |
46 | compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels"); |
|
46 | compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels"); | |
47 | } |
|
47 | } | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | ChartView { |
|
50 | ChartView { | |
51 | id: chartView |
|
51 | id: chartView | |
52 | anchors.fill: parent |
|
52 | anchors.fill: parent | |
53 |
|
53 | |||
54 | LineSeries { |
|
54 | LineSeries { | |
55 | id: lineSeries1 |
|
55 | id: lineSeries1 | |
56 | axisX: ValuesAxis { |
|
56 | axisX: ValuesAxis { | |
57 | id: axisX |
|
57 | id: axisX | |
58 | min: 0 |
|
58 | min: 0 | |
59 | max: 10 |
|
59 | max: 10 | |
60 | } |
|
60 | } | |
61 | axisY: CategoryAxis { |
|
61 | axisY: CategoryAxis { | |
62 | id: axisY |
|
62 | id: axisY | |
63 | min: 0 |
|
63 | min: 0 | |
64 | max: 10 |
|
64 | max: 10 | |
65 | startValue: 0 |
|
65 | startValue: 0 | |
66 | CategoryRange { |
|
66 | CategoryRange { | |
67 | label: "label0" |
|
67 | label: "label0" | |
68 | endValue: 1 |
|
68 | endValue: 1 | |
69 | } |
|
69 | } | |
70 | CategoryRange { |
|
70 | CategoryRange { | |
71 | label: "label1" |
|
71 | label: "label1" | |
72 | endValue: 3 |
|
72 | endValue: 3 | |
73 | } |
|
73 | } | |
74 | CategoryRange { |
|
74 | CategoryRange { | |
75 | label: "label2" |
|
75 | label: "label2" | |
76 | endValue: 10 |
|
76 | endValue: 10 | |
77 | } |
|
77 | } | |
78 | } |
|
78 | } | |
79 | XYPoint { x: -1; y: -1 } |
|
79 | XYPoint { x: -1; y: -1 } | |
80 | XYPoint { x: 0; y: 0 } |
|
80 | XYPoint { x: 0; y: 0 } | |
81 | XYPoint { x: 5; y: 5 } |
|
81 | XYPoint { x: 5; y: 5 } | |
82 | } |
|
82 | } | |
83 | } |
|
83 | } | |
84 | } |
|
84 | } |
@@ -1,80 +1,80 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest ChartView Properties" |
|
31 | name: "tst_qml-qtquicktest ChartView Properties" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_chartViewProperties() { |
|
34 | function test_chartViewProperties() { | |
35 | compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions"); |
|
35 | compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions"); | |
36 | verify(chartView.backgroundColor != undefined); |
|
36 | verify(chartView.backgroundColor != undefined); | |
37 | verify(chartView.margins.bottom > 0, "ChartView.margins.bottom"); |
|
37 | verify(chartView.margins.bottom > 0, "ChartView.margins.bottom"); | |
38 | verify(chartView.margins.top > 0, "ChartView.margins.top"); |
|
38 | verify(chartView.margins.top > 0, "ChartView.margins.top"); | |
39 | verify(chartView.margins.left > 0, "ChartView.margins.left"); |
|
39 | verify(chartView.margins.left > 0, "ChartView.margins.left"); | |
40 | verify(chartView.margins.right > 0, "ChartView.margins.right"); |
|
40 | verify(chartView.margins.right > 0, "ChartView.margins.right"); | |
41 | compare(chartView.count, 0, "ChartView.count"); |
|
41 | compare(chartView.count, 0, "ChartView.count"); | |
42 | compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled"); |
|
42 | compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled"); | |
43 | verify(chartView.plotArea.height > 0, "ChartView.plotArea.height"); |
|
43 | verify(chartView.plotArea.height > 0, "ChartView.plotArea.height"); | |
44 | verify(chartView.plotArea.width > 0, "ChartView.plotArea.width"); |
|
44 | verify(chartView.plotArea.width > 0, "ChartView.plotArea.width"); | |
45 | verify(chartView.plotArea.x > 0, "ChartView.plotArea.x"); |
|
45 | verify(chartView.plotArea.x > 0, "ChartView.plotArea.x"); | |
46 | verify(chartView.plotArea.y > 0, "ChartView.plotArea.y"); |
|
46 | verify(chartView.plotArea.y > 0, "ChartView.plotArea.y"); | |
47 | compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme"); |
|
47 | compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme"); | |
48 | compare(chartView.title, "", "ChartView.title"); |
|
48 | compare(chartView.title, "", "ChartView.title"); | |
49 | compare(chartView.title, "", "ChartView.title"); |
|
49 | compare(chartView.title, "", "ChartView.title"); | |
50 | verify(chartView.titleColor != undefined, "ChartView.titleColor"); |
|
50 | verify(chartView.titleColor != undefined, "ChartView.titleColor"); | |
51 | compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold"); |
|
51 | compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold"); | |
52 | // Legend |
|
52 | // Legend | |
53 | compare(chartView.legend.visible, true, "ChartView.legend.visible"); |
|
53 | compare(chartView.legend.visible, true, "ChartView.legend.visible"); | |
54 | compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment"); |
|
54 | compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment"); | |
55 | compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible"); |
|
55 | compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible"); | |
56 | verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor"); |
|
56 | verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor"); | |
57 | verify(chartView.legend.color != undefined, "ChartView.legend.color"); |
|
57 | verify(chartView.legend.color != undefined, "ChartView.legend.color"); | |
58 | compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers"); |
|
58 | compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers"); | |
59 | // Legend font |
|
59 | // Legend font | |
60 | compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold"); |
|
60 | compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold"); | |
61 | compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization"); |
|
61 | compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization"); | |
62 | verify(chartView.legend.font.family != "", "ChartView.legend.font.family"); |
|
62 | verify(chartView.legend.font.family != "", "ChartView.legend.font.family"); | |
63 | compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic"); |
|
63 | compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic"); | |
64 | compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing"); |
|
64 | compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing"); | |
65 | verify(chartView.legend.font.pixelSize > 0 |
|
65 | verify(chartView.legend.font.pixelSize > 0 | |
66 | && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize"); |
|
66 | && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize"); | |
67 | verify(chartView.legend.font.pointSize > 0 |
|
67 | verify(chartView.legend.font.pointSize > 0 | |
68 | && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize"); |
|
68 | && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize"); | |
69 | compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout"); |
|
69 | compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout"); | |
70 | compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline"); |
|
70 | compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline"); | |
71 | compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight"); |
|
71 | compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight"); | |
72 | compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing"); |
|
72 | compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing"); | |
73 | } |
|
73 | } | |
74 | } |
|
74 | } | |
75 |
|
75 | |||
76 | ChartView { |
|
76 | ChartView { | |
77 | id: chartView |
|
77 | id: chartView | |
78 | anchors.fill: parent |
|
78 | anchors.fill: parent | |
79 | } |
|
79 | } | |
80 | } |
|
80 | } |
@@ -1,160 +1,160 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest ChartView Functions" |
|
31 | name: "tst_qml-qtquicktest ChartView Functions" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_chartViewSeriesAndAxes() { |
|
34 | function test_chartViewSeriesAndAxes() { | |
35 | // Create XY series |
|
35 | // Create XY series | |
36 | var line = chartView.createSeries(ChartView.SeriesTypeLine, "line"); |
|
36 | var line = chartView.createSeries(ChartView.SeriesTypeLine, "line"); | |
37 | verify(line != null && line != undefined); |
|
37 | verify(line != null && line != undefined); | |
38 | var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline"); |
|
38 | var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline"); | |
39 | verify(spline != null && spline != undefined); |
|
39 | verify(spline != null && spline != undefined); | |
40 | var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter"); |
|
40 | var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter"); | |
41 | verify(scatter != null && scatter != undefined); |
|
41 | verify(scatter != null && scatter != undefined); | |
42 |
|
42 | |||
43 | // Create a series with specific axes |
|
43 | // Create a series with specific axes | |
44 | var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line)); |
|
44 | var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line)); | |
45 |
|
45 | |||
46 | // Check that all the XY series use the same axes |
|
46 | // Check that all the XY series use the same axes | |
47 | verify(chartView.axisX(line) != null); |
|
47 | verify(chartView.axisX(line) != null); | |
48 | verify(chartView.axisY(line) != null); |
|
48 | verify(chartView.axisY(line) != null); | |
49 | compare(chartView.axisX(line), chartView.axisX(line2)); |
|
49 | compare(chartView.axisX(line), chartView.axisX(line2)); | |
50 | compare(chartView.axisY(line), chartView.axisY(line2)); |
|
50 | compare(chartView.axisY(line), chartView.axisY(line2)); | |
51 | compare(chartView.axisX(line), chartView.axisX(spline)); |
|
51 | compare(chartView.axisX(line), chartView.axisX(spline)); | |
52 | compare(chartView.axisY(line), chartView.axisY(spline)); |
|
52 | compare(chartView.axisY(line), chartView.axisY(spline)); | |
53 | compare(chartView.axisX(line), chartView.axisX(scatter)); |
|
53 | compare(chartView.axisX(line), chartView.axisX(scatter)); | |
54 | compare(chartView.axisY(line), chartView.axisY(scatter)); |
|
54 | compare(chartView.axisY(line), chartView.axisY(scatter)); | |
55 |
|
55 | |||
56 | var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar"); |
|
56 | var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar"); | |
57 | verify(bar != null && bar != undefined); |
|
57 | verify(bar != null && bar != undefined); | |
58 | var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar"); |
|
58 | var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar"); | |
59 | verify(stackedbar != null && stackedbar != undefined); |
|
59 | verify(stackedbar != null && stackedbar != undefined); | |
60 | var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar"); |
|
60 | var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar"); | |
61 | verify(percentbar != null && percentbar != undefined); |
|
61 | verify(percentbar != null && percentbar != undefined); | |
62 | var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar"); |
|
62 | var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar"); | |
63 | verify(horizontalbar != null && horizontalbar != undefined); |
|
63 | verify(horizontalbar != null && horizontalbar != undefined); | |
64 | var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar"); |
|
64 | var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar"); | |
65 | verify(horizontalstackedbar != null && horizontalstackedbar != undefined); |
|
65 | verify(horizontalstackedbar != null && horizontalstackedbar != undefined); | |
66 | var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar"); |
|
66 | var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar"); | |
67 | verify(horizontalpercentbar != null && horizontalpercentbar != undefined); |
|
67 | verify(horizontalpercentbar != null && horizontalpercentbar != undefined); | |
68 | var area = chartView.createSeries(ChartView.SeriesTypeArea, "area"); |
|
68 | var area = chartView.createSeries(ChartView.SeriesTypeArea, "area"); | |
69 | verify(area != null && area != undefined); |
|
69 | verify(area != null && area != undefined); | |
70 |
|
70 | |||
71 | // Remove all series |
|
71 | // Remove all series | |
72 | chartView.removeAllSeries(); |
|
72 | chartView.removeAllSeries(); | |
73 | compare(chartView.count, 0); |
|
73 | compare(chartView.count, 0); | |
74 | } |
|
74 | } | |
75 |
|
75 | |||
76 | function test_chartViewRange() { |
|
76 | function test_chartViewRange() { | |
77 | // Set initial values |
|
77 | // Set initial values | |
78 | chartView.createSeries(ChartView.SeriesTypeLine, "line"); |
|
78 | chartView.createSeries(ChartView.SeriesTypeLine, "line"); | |
79 | verify(chartView.axisX() != null); |
|
79 | verify(chartView.axisX() != null); | |
80 | verify(chartView.axisY() != null); |
|
80 | verify(chartView.axisY() != null); | |
81 | chartView.axisX().min = 1.0; |
|
81 | chartView.axisX().min = 1.0; | |
82 | chartView.axisX().max = 2.0; |
|
82 | chartView.axisX().max = 2.0; | |
83 | chartView.axisY().min = 1.0; |
|
83 | chartView.axisY().min = 1.0; | |
84 | chartView.axisY().max = 2.0; |
|
84 | chartView.axisY().max = 2.0; | |
85 |
|
85 | |||
86 | var xMax = chartView.axisX().max; |
|
86 | var xMax = chartView.axisX().max; | |
87 | var xMin = chartView.axisX().min; |
|
87 | var xMin = chartView.axisX().min; | |
88 | var yMax = chartView.axisY().max; |
|
88 | var yMax = chartView.axisY().max; | |
89 | var yMin = chartView.axisY().min; |
|
89 | var yMin = chartView.axisY().min; | |
90 |
|
90 | |||
91 | // zoom x 2.5 |
|
91 | // zoom x 2.5 | |
92 | chartView.zoom(1.5); |
|
92 | chartView.zoom(1.5); | |
93 | verify(chartView.axisX().max < xMax); |
|
93 | verify(chartView.axisX().max < xMax); | |
94 | verify(chartView.axisX().min > xMin); |
|
94 | verify(chartView.axisX().min > xMin); | |
95 | verify(chartView.axisY().max < yMax); |
|
95 | verify(chartView.axisY().max < yMax); | |
96 | verify(chartView.axisY().min > yMin); |
|
96 | verify(chartView.axisY().min > yMin); | |
97 | xMax = chartView.axisX().max; |
|
97 | xMax = chartView.axisX().max; | |
98 | xMin = chartView.axisX().min; |
|
98 | xMin = chartView.axisX().min; | |
99 | yMax = chartView.axisY().max; |
|
99 | yMax = chartView.axisY().max; | |
100 | yMin = chartView.axisY().min; |
|
100 | yMin = chartView.axisY().min; | |
101 |
|
101 | |||
102 | // zoom x 0.5 |
|
102 | // zoom x 0.5 | |
103 | chartView.zoom(0.5); |
|
103 | chartView.zoom(0.5); | |
104 | verify(chartView.axisX().max > xMax); |
|
104 | verify(chartView.axisX().max > xMax); | |
105 | verify(chartView.axisX().min < xMin); |
|
105 | verify(chartView.axisX().min < xMin); | |
106 | verify(chartView.axisY().max > yMax); |
|
106 | verify(chartView.axisY().max > yMax); | |
107 | verify(chartView.axisY().min < yMin); |
|
107 | verify(chartView.axisY().min < yMin); | |
108 | xMax = chartView.axisX().max; |
|
108 | xMax = chartView.axisX().max; | |
109 | xMin = chartView.axisX().min; |
|
109 | xMin = chartView.axisX().min; | |
110 | yMax = chartView.axisY().max; |
|
110 | yMax = chartView.axisY().max; | |
111 | yMin = chartView.axisY().min; |
|
111 | yMin = chartView.axisY().min; | |
112 |
|
112 | |||
113 | // Scroll up |
|
113 | // Scroll up | |
114 | chartView.scrollUp(10); |
|
114 | chartView.scrollUp(10); | |
115 | compare(chartView.axisX().max, xMax); |
|
115 | compare(chartView.axisX().max, xMax); | |
116 | compare(chartView.axisX().min, xMin); |
|
116 | compare(chartView.axisX().min, xMin); | |
117 | verify(chartView.axisY().max > yMax); |
|
117 | verify(chartView.axisY().max > yMax); | |
118 | verify(chartView.axisY().min > yMin); |
|
118 | verify(chartView.axisY().min > yMin); | |
119 | xMax = chartView.axisX().max; |
|
119 | xMax = chartView.axisX().max; | |
120 | xMin = chartView.axisX().min; |
|
120 | xMin = chartView.axisX().min; | |
121 | yMax = chartView.axisY().max; |
|
121 | yMax = chartView.axisY().max; | |
122 | yMin = chartView.axisY().min; |
|
122 | yMin = chartView.axisY().min; | |
123 |
|
123 | |||
124 | // Scroll down |
|
124 | // Scroll down | |
125 | chartView.scrollDown(10); |
|
125 | chartView.scrollDown(10); | |
126 | compare(chartView.axisX().max, xMax); |
|
126 | compare(chartView.axisX().max, xMax); | |
127 | compare(chartView.axisX().min, xMin); |
|
127 | compare(chartView.axisX().min, xMin); | |
128 | verify(chartView.axisY().max < yMax); |
|
128 | verify(chartView.axisY().max < yMax); | |
129 | verify(chartView.axisY().min < yMin); |
|
129 | verify(chartView.axisY().min < yMin); | |
130 | xMax = chartView.axisX().max; |
|
130 | xMax = chartView.axisX().max; | |
131 | xMin = chartView.axisX().min; |
|
131 | xMin = chartView.axisX().min; | |
132 | yMax = chartView.axisY().max; |
|
132 | yMax = chartView.axisY().max; | |
133 | yMin = chartView.axisY().min; |
|
133 | yMin = chartView.axisY().min; | |
134 |
|
134 | |||
135 | // Scroll left |
|
135 | // Scroll left | |
136 | chartView.scrollLeft(10); |
|
136 | chartView.scrollLeft(10); | |
137 | verify(chartView.axisX().max < xMax); |
|
137 | verify(chartView.axisX().max < xMax); | |
138 | verify(chartView.axisX().min < xMin); |
|
138 | verify(chartView.axisX().min < xMin); | |
139 | compare(chartView.axisY().max, yMax); |
|
139 | compare(chartView.axisY().max, yMax); | |
140 | compare(chartView.axisY().min, yMin); |
|
140 | compare(chartView.axisY().min, yMin); | |
141 | xMax = chartView.axisX().max; |
|
141 | xMax = chartView.axisX().max; | |
142 | xMin = chartView.axisX().min; |
|
142 | xMin = chartView.axisX().min; | |
143 | yMax = chartView.axisY().max; |
|
143 | yMax = chartView.axisY().max; | |
144 | yMin = chartView.axisY().min; |
|
144 | yMin = chartView.axisY().min; | |
145 |
|
145 | |||
146 | // Scroll right |
|
146 | // Scroll right | |
147 | chartView.scrollRight(10); |
|
147 | chartView.scrollRight(10); | |
148 | verify(chartView.axisX().max > xMax); |
|
148 | verify(chartView.axisX().max > xMax); | |
149 | verify(chartView.axisX().min > xMin); |
|
149 | verify(chartView.axisX().min > xMin); | |
150 | compare(chartView.axisY().max, yMax); |
|
150 | compare(chartView.axisY().max, yMax); | |
151 | compare(chartView.axisY().min, yMin); |
|
151 | compare(chartView.axisY().min, yMin); | |
152 | } |
|
152 | } | |
153 | } |
|
153 | } | |
154 |
|
154 | |||
155 | ChartView { |
|
155 | ChartView { | |
156 | id: chartView |
|
156 | id: chartView | |
157 | anchors.fill: parent |
|
157 | anchors.fill: parent | |
158 | title: "Chart" |
|
158 | title: "Chart" | |
159 | } |
|
159 | } | |
160 | } |
|
160 | } |
@@ -1,73 +1,73 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest ChartView Signals" |
|
31 | name: "tst_qml-qtquicktest ChartView Signals" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | // Verify onSeriesAdded and onSeriesRemoved signals |
|
34 | // Verify onSeriesAdded and onSeriesRemoved signals | |
35 | function test_chartView() { |
|
35 | function test_chartView() { | |
36 | var series = chartView.createSeries(ChartView.SeriesTypeLine, "line"); |
|
36 | var series = chartView.createSeries(ChartView.SeriesTypeLine, "line"); | |
37 | seriesAddedSpy.wait(); |
|
37 | seriesAddedSpy.wait(); | |
38 | compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded"); |
|
38 | compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded"); | |
39 |
|
39 | |||
40 | // Modifying layout triggers more than one plotAreaChanged signal |
|
40 | // Modifying layout triggers more than one plotAreaChanged signal | |
41 | chartView.titleFont.pixelSize = 50; |
|
41 | chartView.titleFont.pixelSize = 50; | |
42 | verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged"); |
|
42 | verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged"); | |
43 |
|
43 | |||
44 | chartView.removeSeries(series); |
|
44 | chartView.removeSeries(series); | |
45 | seriesRemovedSpy.wait(); |
|
45 | seriesRemovedSpy.wait(); | |
46 | compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded"); |
|
46 | compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded"); | |
47 | } |
|
47 | } | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | ChartView { |
|
50 | ChartView { | |
51 | id: chartView |
|
51 | id: chartView | |
52 | anchors.fill: parent |
|
52 | anchors.fill: parent | |
53 | title: "Chart" |
|
53 | title: "Chart" | |
54 |
|
54 | |||
55 | SignalSpy { |
|
55 | SignalSpy { | |
56 | id: plotAreaChangedSpy |
|
56 | id: plotAreaChangedSpy | |
57 | target: chartView |
|
57 | target: chartView | |
58 | signalName: "plotAreaChanged" |
|
58 | signalName: "plotAreaChanged" | |
59 | } |
|
59 | } | |
60 |
|
60 | |||
61 | SignalSpy { |
|
61 | SignalSpy { | |
62 | id: seriesAddedSpy |
|
62 | id: seriesAddedSpy | |
63 | target: chartView |
|
63 | target: chartView | |
64 | signalName: "seriesAdded" |
|
64 | signalName: "seriesAdded" | |
65 | } |
|
65 | } | |
66 |
|
66 | |||
67 | SignalSpy { |
|
67 | SignalSpy { | |
68 | id: seriesRemovedSpy |
|
68 | id: seriesRemovedSpy | |
69 | target: chartView |
|
69 | target: chartView | |
70 | signalName: "seriesRemoved" |
|
70 | signalName: "seriesRemoved" | |
71 | } |
|
71 | } | |
72 | } |
|
72 | } | |
73 | } |
|
73 | } |
@@ -1,131 +1,135 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest PieSeries" |
|
31 | name: "tst_qml-qtquicktest PieSeries" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_properties() { |
|
34 | function test_properties() { | |
35 | compare(pieSeries.endAngle, 360); |
|
35 | compare(pieSeries.endAngle, 360); | |
36 | compare(pieSeries.holeSize, 0); |
|
36 | compare(pieSeries.holeSize, 0); | |
37 | compare(pieSeries.horizontalPosition, 0.5); |
|
37 | compare(pieSeries.horizontalPosition, 0.5); | |
38 | compare(pieSeries.size, 0.7); |
|
38 | compare(pieSeries.size, 0.7); | |
39 | compare(pieSeries.startAngle, 0); |
|
39 | compare(pieSeries.startAngle, 0); | |
40 | compare(pieSeries.sum, 0); |
|
40 | compare(pieSeries.sum, 0); | |
41 | compare(pieSeries.verticalPosition, 0.5); |
|
41 | compare(pieSeries.verticalPosition, 0.5); | |
42 | } |
|
42 | } | |
43 |
|
43 | |||
44 | function test_sliceproperties() { |
|
44 | function test_sliceproperties() { | |
45 | var slice = pieSeries.append("slice", 10); |
|
45 | var slice = pieSeries.append("slice", 10); | |
46 | compare(slice.angleSpan, 360.0); |
|
46 | compare(slice.angleSpan, 360.0); | |
47 | verify(slice.borderColor != undefined); |
|
47 | verify(slice.borderColor != undefined); | |
48 | compare(slice.borderWidth, 1); |
|
48 | compare(slice.borderWidth, 1); | |
49 | verify(slice.color != undefined); |
|
49 | verify(slice.color != undefined); | |
50 | compare(slice.explodeDistanceFactor, 0.15); |
|
50 | compare(slice.explodeDistanceFactor, 0.15); | |
51 | compare(slice.exploded, false); |
|
51 | compare(slice.exploded, false); | |
52 | compare(slice.label, "slice"); |
|
52 | compare(slice.label, "slice"); | |
53 | compare(slice.labelArmLengthFactor, 0.15); |
|
53 | compare(slice.labelArmLengthFactor, 0.15); | |
54 | verify(slice.labelColor != undefined); |
|
54 | verify(slice.labelColor != undefined); | |
55 | compare(slice.labelFont.bold, false); |
|
55 | compare(slice.labelFont.bold, false); | |
56 | compare(slice.labelPosition, PieSlice.LabelOutside); |
|
56 | compare(slice.labelPosition, PieSlice.LabelOutside); | |
57 | compare(slice.labelVisible, false); |
|
57 | compare(slice.labelVisible, false); | |
58 | compare(slice.percentage, 1.0); |
|
58 | compare(slice.percentage, 1.0); | |
59 | compare(slice.startAngle, 0.0); |
|
59 | compare(slice.startAngle, 0.0); | |
60 | compare(slice.value, 10.0); |
|
60 | compare(slice.value, 10.0); | |
|
61 | compare(slice.brushFilename, ""); | |||
61 | } |
|
62 | } | |
62 |
|
63 | |||
63 | function test_append() { |
|
64 | function test_append() { | |
64 | addedSpy.clear(); |
|
65 | addedSpy.clear(); | |
65 | countChangedSpy.clear(); |
|
66 | countChangedSpy.clear(); | |
66 | sumChangedSpy.clear(); |
|
67 | sumChangedSpy.clear(); | |
67 | var count = 50; |
|
68 | var count = 50; | |
68 | for (var i = 0; i < count; i++) |
|
69 | for (var i = 0; i < count; i++) | |
69 | pieSeries.append("slice" + i, Math.random()); |
|
70 | pieSeries.append("slice" + i, Math.random()); | |
70 | compare(addedSpy.count, count); |
|
71 | compare(addedSpy.count, count); | |
71 | compare(countChangedSpy.count, count); |
|
72 | compare(countChangedSpy.count, count); | |
72 | compare(sumChangedSpy.count, count); |
|
73 | compare(sumChangedSpy.count, count); | |
73 | pieSeries.clear(); |
|
74 | pieSeries.clear(); | |
74 | } |
|
75 | } | |
75 |
|
76 | |||
76 | function test_remove() { |
|
77 | function test_remove() { | |
77 | removedSpy.clear(); |
|
78 | removedSpy.clear(); | |
78 | countChangedSpy.clear(); |
|
79 | countChangedSpy.clear(); | |
79 | sumChangedSpy.clear(); |
|
80 | sumChangedSpy.clear(); | |
80 | var count = 50; |
|
81 | var count = 50; | |
81 | for (var i = 0; i < count; i++) |
|
82 | for (var i = 0; i < count; i++) | |
82 | pieSeries.append("slice" + i, Math.random()); |
|
83 | pieSeries.append("slice" + i, Math.random()); | |
83 | for (var j = 0; j < count; j++) |
|
84 | for (var j = 0; j < count; j++) | |
84 | pieSeries.remove(pieSeries.at(0)); |
|
85 | pieSeries.remove(pieSeries.at(0)); | |
85 | compare(removedSpy.count, count); |
|
86 | compare(removedSpy.count, count); | |
86 | compare(countChangedSpy.count, 2 * count); |
|
87 | compare(countChangedSpy.count, 2 * count); | |
87 | compare(sumChangedSpy.count, 2 * count); |
|
88 | compare(sumChangedSpy.count, 2 * count); | |
88 | compare(pieSeries.count, 0); |
|
89 | compare(pieSeries.count, 0); | |
89 | } |
|
90 | } | |
90 |
|
91 | |||
91 | function test_find() { |
|
92 | function test_find_and_at() { | |
92 | var count = 50; |
|
93 | var count = 50; | |
93 | for (var i = 0; i < count; i++) |
|
94 | for (var i = 0; i < count; i++) | |
94 | pieSeries.append("slice" + i, Math.random()); |
|
95 | pieSeries.append("slice" + i, Math.random()); | |
95 | for (var j = 0; j < count; j++) |
|
96 | for (var j = 0; j < count; j++) { | |
96 | compare(pieSeries.find("slice" + j).label, "slice" + j); |
|
97 | compare(pieSeries.find("slice" + j).label, "slice" + j); | |
|
98 | compare(pieSeries.find("slice" + j).brushFilename, ""); | |||
|
99 | } | |||
|
100 | compare(pieSeries.at(3).brushFilename,""); | |||
97 | pieSeries.clear(); |
|
101 | pieSeries.clear(); | |
98 | } |
|
102 | } | |
99 | } |
|
103 | } | |
100 |
|
104 | |||
101 | ChartView { |
|
105 | ChartView { | |
102 | id: chartView |
|
106 | id: chartView | |
103 | anchors.fill: parent |
|
107 | anchors.fill: parent | |
104 |
|
108 | |||
105 | PieSeries { |
|
109 | PieSeries { | |
106 | id: pieSeries |
|
110 | id: pieSeries | |
107 | name: "pie" |
|
111 | name: "pie" | |
108 |
|
112 | |||
109 | SignalSpy { |
|
113 | SignalSpy { | |
110 | id: addedSpy |
|
114 | id: addedSpy | |
111 | target: pieSeries |
|
115 | target: pieSeries | |
112 | signalName: "added" |
|
116 | signalName: "added" | |
113 | } |
|
117 | } | |
114 | SignalSpy { |
|
118 | SignalSpy { | |
115 | id: removedSpy |
|
119 | id: removedSpy | |
116 | target: pieSeries |
|
120 | target: pieSeries | |
117 | signalName: "removed" |
|
121 | signalName: "removed" | |
118 | } |
|
122 | } | |
119 | SignalSpy { |
|
123 | SignalSpy { | |
120 | id: sumChangedSpy |
|
124 | id: sumChangedSpy | |
121 | target: pieSeries |
|
125 | target: pieSeries | |
122 | signalName: "sumChanged" |
|
126 | signalName: "sumChanged" | |
123 | } |
|
127 | } | |
124 | SignalSpy { |
|
128 | SignalSpy { | |
125 | id: countChangedSpy |
|
129 | id: countChangedSpy | |
126 | target: pieSeries |
|
130 | target: pieSeries | |
127 | signalName: "countChanged" |
|
131 | signalName: "countChanged" | |
128 | } |
|
132 | } | |
129 | } |
|
133 | } | |
130 | } |
|
134 | } | |
131 | } |
|
135 | } |
@@ -1,116 +1,116 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest ValueAxis" |
|
31 | name: "tst_qml-qtquicktest ValueAxis" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | // test functions are run in alphabetical order, the name has 'a' so that it |
|
34 | // test functions are run in alphabetical order, the name has 'a' so that it | |
35 | // will be the first function to execute. |
|
35 | // will be the first function to execute. | |
36 | function test_a_properties() { |
|
36 | function test_a_properties() { | |
37 | // Default properties |
|
37 | // Default properties | |
38 | verify(axisX.min < 0, "AxisX min"); |
|
38 | verify(axisX.min < 0, "AxisX min"); | |
39 | verify(axisX.max > 0, "AxisX max"); |
|
39 | verify(axisX.max > 0, "AxisX max"); | |
40 | verify(axisY.min < 0, "AxisY min"); |
|
40 | verify(axisY.min < 0, "AxisY min"); | |
41 | verify(axisY.max > 0, "AxisY max"); |
|
41 | verify(axisY.max > 0, "AxisY max"); | |
42 | verify(axisX.tickCount == 5, "AxisX tick count"); |
|
42 | verify(axisX.tickCount == 5, "AxisX tick count"); | |
43 | verify(axisY.tickCount == 5, "AxisY tick count"); |
|
43 | verify(axisY.tickCount == 5, "AxisY tick count"); | |
44 | verify(axisX.labelFormat == "", "label format"); |
|
44 | verify(axisX.labelFormat == "", "label format"); | |
45 |
|
45 | |||
46 | // Modify properties |
|
46 | // Modify properties | |
47 | axisX.tickCount = 3; |
|
47 | axisX.tickCount = 3; | |
48 | verify(axisX.tickCount == 3, "set tick count"); |
|
48 | verify(axisX.tickCount == 3, "set tick count"); | |
49 | } |
|
49 | } | |
50 |
|
50 | |||
51 | function test_functions() { |
|
51 | function test_functions() { | |
52 | // Set the axis ranges to not "nice" ones... |
|
52 | // Set the axis ranges to not "nice" ones... | |
53 | var min = 0.032456456; |
|
53 | var min = 0.032456456; | |
54 | var max = 10.67845634; |
|
54 | var max = 10.67845634; | |
55 | axisX.min = min; |
|
55 | axisX.min = min; | |
56 | axisX.max = max; |
|
56 | axisX.max = max; | |
57 | axisY.min = min; |
|
57 | axisY.min = min; | |
58 | axisY.max = max; |
|
58 | axisY.max = max; | |
59 |
|
59 | |||
60 | // ...And then apply nice numbers and verify the range was changed |
|
60 | // ...And then apply nice numbers and verify the range was changed | |
61 | axisX.applyNiceNumbers(); |
|
61 | axisX.applyNiceNumbers(); | |
62 | axisY.applyNiceNumbers(); |
|
62 | axisY.applyNiceNumbers(); | |
63 | verify(axisX.min != min); |
|
63 | verify(axisX.min != min); | |
64 | verify(axisX.max != max); |
|
64 | verify(axisX.max != max); | |
65 | verify(axisY.min != min); |
|
65 | verify(axisY.min != min); | |
66 | verify(axisY.max != max); |
|
66 | verify(axisY.max != max); | |
67 | } |
|
67 | } | |
68 |
|
68 | |||
69 | function test_signals() { |
|
69 | function test_signals() { | |
70 | minChangedSpy.clear(); |
|
70 | minChangedSpy.clear(); | |
71 | maxChangedSpy.clear(); |
|
71 | maxChangedSpy.clear(); | |
72 | axisX.min = 2; |
|
72 | axisX.min = 2; | |
73 | compare(minChangedSpy.count, 1, "onMinChanged"); |
|
73 | compare(minChangedSpy.count, 1, "onMinChanged"); | |
74 | compare(maxChangedSpy.count, 0, "onMaxChanged"); |
|
74 | compare(maxChangedSpy.count, 0, "onMaxChanged"); | |
75 |
|
75 | |||
76 | axisX.max = 8; |
|
76 | axisX.max = 8; | |
77 | compare(minChangedSpy.count, 1, "onMinChanged"); |
|
77 | compare(minChangedSpy.count, 1, "onMinChanged"); | |
78 | compare(maxChangedSpy.count, 1, "onMaxChanged"); |
|
78 | compare(maxChangedSpy.count, 1, "onMaxChanged"); | |
79 |
|
79 | |||
80 | // restore original values |
|
80 | // restore original values | |
81 | axisX.min = 0; |
|
81 | axisX.min = 0; | |
82 | axisX.max = 10; |
|
82 | axisX.max = 10; | |
83 | compare(minChangedSpy.count, 2, "onMinChanged"); |
|
83 | compare(minChangedSpy.count, 2, "onMinChanged"); | |
84 | compare(maxChangedSpy.count, 2, "onMaxChanged"); |
|
84 | compare(maxChangedSpy.count, 2, "onMaxChanged"); | |
85 | } |
|
85 | } | |
86 | } |
|
86 | } | |
87 |
|
87 | |||
88 | ChartView { |
|
88 | ChartView { | |
89 | id: chartView |
|
89 | id: chartView | |
90 | anchors.fill: parent |
|
90 | anchors.fill: parent | |
91 |
|
91 | |||
92 | LineSeries { |
|
92 | LineSeries { | |
93 | id: lineSeries1 |
|
93 | id: lineSeries1 | |
94 | axisX: ValueAxis { |
|
94 | axisX: ValueAxis { | |
95 | id: axisX |
|
95 | id: axisX | |
96 | } |
|
96 | } | |
97 | axisY: ValueAxis { |
|
97 | axisY: ValueAxis { | |
98 | id: axisY |
|
98 | id: axisY | |
99 | } |
|
99 | } | |
100 | XYPoint { x: -1; y: -1 } |
|
100 | XYPoint { x: -1; y: -1 } | |
101 | XYPoint { x: 0; y: 0 } |
|
101 | XYPoint { x: 0; y: 0 } | |
102 | XYPoint { x: 5; y: 5 } |
|
102 | XYPoint { x: 5; y: 5 } | |
103 | } |
|
103 | } | |
104 |
|
104 | |||
105 | SignalSpy { |
|
105 | SignalSpy { | |
106 | id: minChangedSpy |
|
106 | id: minChangedSpy | |
107 | target: axisX |
|
107 | target: axisX | |
108 | signalName: "minChanged" |
|
108 | signalName: "minChanged" | |
109 | } |
|
109 | } | |
110 | SignalSpy { |
|
110 | SignalSpy { | |
111 | id: maxChangedSpy |
|
111 | id: maxChangedSpy | |
112 | target: axisX |
|
112 | target: axisX | |
113 | signalName: "maxChanged" |
|
113 | signalName: "maxChanged" | |
114 | } |
|
114 | } | |
115 | } |
|
115 | } | |
116 | } |
|
116 | } |
@@ -1,260 +1,262 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2013 Digia Plc |
|
3 | ** Copyright (C) 2013 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Enterprise Charts Add-on. |
|
7 | ** This file is part of the Qt Enterprise Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in |
|
10 | ** Licensees holding valid Qt Enterprise licenses may use this file in | |
11 | ** accordance with the Qt Enterprise License Agreement provided with the |
|
11 | ** accordance with the Qt Enterprise License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | import QtQuick 2.0 |
|
21 | import QtQuick 2.0 | |
22 | import QtTest 1.0 |
|
22 | import QtTest 1.0 | |
23 |
import QtCommercial.Chart 1. |
|
23 | import QtCommercial.Chart 1.4 | |
24 |
|
24 | |||
25 | Rectangle { |
|
25 | Rectangle { | |
26 | width: 400 |
|
26 | width: 400 | |
27 | height: 300 |
|
27 | height: 300 | |
28 |
|
28 | |||
29 | TestCase { |
|
29 | TestCase { | |
30 | id: tc1 |
|
30 | id: tc1 | |
31 | name: "tst_qml-qtquicktest XY Series" |
|
31 | name: "tst_qml-qtquicktest XY Series" | |
32 | when: windowShown |
|
32 | when: windowShown | |
33 |
|
33 | |||
34 | function test_properties() { |
|
34 | function test_properties() { | |
35 | verify(lineSeries.color != undefined); |
|
35 | verify(lineSeries.color != undefined); | |
36 | compare(lineSeries.pointsVisible, false); |
|
36 | compare(lineSeries.pointsVisible, false); | |
37 | compare(lineSeries.capStyle, Qt.SquareCap); |
|
37 | compare(lineSeries.capStyle, Qt.SquareCap); | |
38 | compare(lineSeries.style, Qt.SolidLine); |
|
38 | compare(lineSeries.style, Qt.SolidLine); | |
39 | compare(lineSeries.width, 2.0); |
|
39 | compare(lineSeries.width, 2.0); | |
40 |
|
40 | |||
41 | verify(splineSeries.color != undefined); |
|
41 | verify(splineSeries.color != undefined); | |
42 | compare(splineSeries.pointsVisible, false); |
|
42 | compare(splineSeries.pointsVisible, false); | |
43 | compare(splineSeries.capStyle, Qt.SquareCap); |
|
43 | compare(splineSeries.capStyle, Qt.SquareCap); | |
44 | compare(splineSeries.style, Qt.SolidLine); |
|
44 | compare(splineSeries.style, Qt.SolidLine); | |
45 | compare(splineSeries.width, 2.0); |
|
45 | compare(splineSeries.width, 2.0); | |
46 |
|
46 | |||
47 | verify(scatterSeries.color != undefined); |
|
47 | verify(scatterSeries.color != undefined); | |
48 | verify(scatterSeries.borderColor != undefined); |
|
48 | verify(scatterSeries.borderColor != undefined); | |
49 | compare(scatterSeries.borderWidth, 2.0); |
|
49 | compare(scatterSeries.borderWidth, 2.0); | |
50 | compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle); |
|
50 | compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle); | |
51 | compare(scatterSeries.markerSize, 15.0); |
|
51 | compare(scatterSeries.markerSize, 15.0); | |
|
52 | compare(scatterSeries.brushFilename, ""); | |||
52 |
|
53 | |||
53 | verify(areaSeries.color != undefined); |
|
54 | verify(areaSeries.color != undefined); | |
54 | verify(areaSeries.borderColor != undefined); |
|
55 | verify(areaSeries.borderColor != undefined); | |
55 | compare(areaSeries.borderWidth, 2.0); |
|
56 | compare(areaSeries.borderWidth, 2.0); | |
|
57 | compare(areaSeries.brushFilename, ""); | |||
56 | } |
|
58 | } | |
57 |
|
59 | |||
58 | function test_axes() { |
|
60 | function test_axes() { | |
59 | // Axis initialization |
|
61 | // Axis initialization | |
60 | compare(chartView.axisX(), lineSeries.axisX); |
|
62 | compare(chartView.axisX(), lineSeries.axisX); | |
61 | compare(chartView.axisY(), lineSeries.axisY); |
|
63 | compare(chartView.axisY(), lineSeries.axisY); | |
62 | compare(lineSeries.axisX, splineSeries.axisX); |
|
64 | compare(lineSeries.axisX, splineSeries.axisX); | |
63 | compare(lineSeries.axisY, splineSeries.axisY); |
|
65 | compare(lineSeries.axisY, splineSeries.axisY); | |
64 | compare(lineSeries.axisX, areaSeries.axisX); |
|
66 | compare(lineSeries.axisX, areaSeries.axisX); | |
65 | compare(lineSeries.axisY, areaSeries.axisY); |
|
67 | compare(lineSeries.axisY, areaSeries.axisY); | |
66 | } |
|
68 | } | |
67 |
|
69 | |||
68 | function test_append() { |
|
70 | function test_append() { | |
69 | lineSeriesPointAddedSpy.clear(); |
|
71 | lineSeriesPointAddedSpy.clear(); | |
70 | splineSeriesPointAddedSpy.clear(); |
|
72 | splineSeriesPointAddedSpy.clear(); | |
71 | scatterSeriesPointAddedSpy.clear(); |
|
73 | scatterSeriesPointAddedSpy.clear(); | |
72 | var count = append(); |
|
74 | var count = append(); | |
73 | compare(lineSeries.count, count); |
|
75 | compare(lineSeries.count, count); | |
74 | compare(splineSeries.count, count); |
|
76 | compare(splineSeries.count, count); | |
75 | compare(scatterSeries.count, count); |
|
77 | compare(scatterSeries.count, count); | |
76 | compare(lineSeriesPointAddedSpy.count, count); |
|
78 | compare(lineSeriesPointAddedSpy.count, count); | |
77 | compare(splineSeriesPointAddedSpy.count, count); |
|
79 | compare(splineSeriesPointAddedSpy.count, count); | |
78 | compare(scatterSeriesPointAddedSpy.count, count); |
|
80 | compare(scatterSeriesPointAddedSpy.count, count); | |
79 | clear(); |
|
81 | clear(); | |
80 | compare(lineSeries.count, 0); |
|
82 | compare(lineSeries.count, 0); | |
81 | compare(splineSeries.count, 0); |
|
83 | compare(splineSeries.count, 0); | |
82 | compare(scatterSeries.count, 0); |
|
84 | compare(scatterSeries.count, 0); | |
83 | } |
|
85 | } | |
84 |
|
86 | |||
85 | function test_replace() { |
|
87 | function test_replace() { | |
86 | var count = append(); |
|
88 | var count = append(); | |
87 | for (var i = 0; i < count; i++) { |
|
89 | for (var i = 0; i < count; i++) { | |
88 | lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random()); |
|
90 | lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random()); | |
89 | splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random()); |
|
91 | splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random()); | |
90 | scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random()); |
|
92 | scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random()); | |
91 | } |
|
93 | } | |
92 | compare(lineSeries.count, count); |
|
94 | compare(lineSeries.count, count); | |
93 | compare(splineSeries.count, count); |
|
95 | compare(splineSeries.count, count); | |
94 | compare(scatterSeries.count, count); |
|
96 | compare(scatterSeries.count, count); | |
95 | compare(lineSeriesPointReplacedSpy.count, count); |
|
97 | compare(lineSeriesPointReplacedSpy.count, count); | |
96 | compare(splineSeriesPointReplacedSpy.count, count); |
|
98 | compare(splineSeriesPointReplacedSpy.count, count); | |
97 | compare(scatterSeriesPointReplacedSpy.count, count); |
|
99 | compare(scatterSeriesPointReplacedSpy.count, count); | |
98 | clear(); |
|
100 | clear(); | |
99 | } |
|
101 | } | |
100 |
|
102 | |||
101 | function test_insert() { |
|
103 | function test_insert() { | |
102 | var count = append(); |
|
104 | var count = append(); | |
103 | lineSeriesPointAddedSpy.clear(); |
|
105 | lineSeriesPointAddedSpy.clear(); | |
104 | splineSeriesPointAddedSpy.clear(); |
|
106 | splineSeriesPointAddedSpy.clear(); | |
105 | scatterSeriesPointAddedSpy.clear(); |
|
107 | scatterSeriesPointAddedSpy.clear(); | |
106 | for (var i = 0; i < count; i++) { |
|
108 | for (var i = 0; i < count; i++) { | |
107 | lineSeries.insert(i * 2, i, Math.random()); |
|
109 | lineSeries.insert(i * 2, i, Math.random()); | |
108 | splineSeries.insert(i * 2, i, Math.random()); |
|
110 | splineSeries.insert(i * 2, i, Math.random()); | |
109 | scatterSeries.insert(i * 2, i, Math.random()); |
|
111 | scatterSeries.insert(i * 2, i, Math.random()); | |
110 | } |
|
112 | } | |
111 | compare(lineSeries.count, count * 2); |
|
113 | compare(lineSeries.count, count * 2); | |
112 | compare(splineSeries.count, count * 2); |
|
114 | compare(splineSeries.count, count * 2); | |
113 | compare(scatterSeries.count, count * 2); |
|
115 | compare(scatterSeries.count, count * 2); | |
114 | compare(lineSeriesPointAddedSpy.count, count); |
|
116 | compare(lineSeriesPointAddedSpy.count, count); | |
115 | compare(splineSeriesPointAddedSpy.count, count); |
|
117 | compare(splineSeriesPointAddedSpy.count, count); | |
116 | compare(scatterSeriesPointAddedSpy.count, count); |
|
118 | compare(scatterSeriesPointAddedSpy.count, count); | |
117 | clear(); |
|
119 | clear(); | |
118 | } |
|
120 | } | |
119 |
|
121 | |||
120 | function test_remove() { |
|
122 | function test_remove() { | |
121 | lineSeriesPointRemovedSpy.clear(); |
|
123 | lineSeriesPointRemovedSpy.clear(); | |
122 | splineSeriesPointRemovedSpy.clear(); |
|
124 | splineSeriesPointRemovedSpy.clear(); | |
123 | scatterSeriesPointRemovedSpy.clear(); |
|
125 | scatterSeriesPointRemovedSpy.clear(); | |
124 | var count = append(); |
|
126 | var count = append(); | |
125 | for (var i = 0; i < count; i++) { |
|
127 | for (var i = 0; i < count; i++) { | |
126 | lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y); |
|
128 | lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y); | |
127 | splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y); |
|
129 | splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y); | |
128 | scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y); |
|
130 | scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y); | |
129 | } |
|
131 | } | |
130 | compare(lineSeries.count, 0); |
|
132 | compare(lineSeries.count, 0); | |
131 | compare(splineSeries.count, 0); |
|
133 | compare(splineSeries.count, 0); | |
132 | compare(scatterSeries.count, 0); |
|
134 | compare(scatterSeries.count, 0); | |
133 | compare(lineSeriesPointRemovedSpy.count, count); |
|
135 | compare(lineSeriesPointRemovedSpy.count, count); | |
134 | compare(splineSeriesPointRemovedSpy.count, count); |
|
136 | compare(splineSeriesPointRemovedSpy.count, count); | |
135 | compare(scatterSeriesPointRemovedSpy.count, count); |
|
137 | compare(scatterSeriesPointRemovedSpy.count, count); | |
136 | } |
|
138 | } | |
137 |
|
139 | |||
138 | // Not a test function, called from test functions |
|
140 | // Not a test function, called from test functions | |
139 | function append() { |
|
141 | function append() { | |
140 | var count = 100; |
|
142 | var count = 100; | |
141 | chartView.axisX().min = 0; |
|
143 | chartView.axisX().min = 0; | |
142 | chartView.axisX().max = 100; |
|
144 | chartView.axisX().max = 100; | |
143 | chartView.axisY().min = 0; |
|
145 | chartView.axisY().min = 0; | |
144 | chartView.axisY().max = 1; |
|
146 | chartView.axisY().max = 1; | |
145 |
|
147 | |||
146 | for (var i = 0; i < count; i++) { |
|
148 | for (var i = 0; i < count; i++) { | |
147 | lineSeries.append(i, Math.random()); |
|
149 | lineSeries.append(i, Math.random()); | |
148 | splineSeries.append(i, Math.random()); |
|
150 | splineSeries.append(i, Math.random()); | |
149 | scatterSeries.append(i, Math.random()); |
|
151 | scatterSeries.append(i, Math.random()); | |
150 | } |
|
152 | } | |
151 |
|
153 | |||
152 | return count; |
|
154 | return count; | |
153 | } |
|
155 | } | |
154 |
|
156 | |||
155 | // Not a test function, called from test functions |
|
157 | // Not a test function, called from test functions | |
156 | function clear() { |
|
158 | function clear() { | |
157 | lineSeries.clear(); |
|
159 | lineSeries.clear(); | |
158 | splineSeries.clear(); |
|
160 | splineSeries.clear(); | |
159 | scatterSeries.clear(); |
|
161 | scatterSeries.clear(); | |
160 | } |
|
162 | } | |
161 | } |
|
163 | } | |
162 |
|
164 | |||
163 | ChartView { |
|
165 | ChartView { | |
164 | id: chartView |
|
166 | id: chartView | |
165 | anchors.fill: parent |
|
167 | anchors.fill: parent | |
166 |
|
168 | |||
167 | LineSeries { |
|
169 | LineSeries { | |
168 | id: lineSeries |
|
170 | id: lineSeries | |
169 | name: "line" |
|
171 | name: "line" | |
170 |
|
172 | |||
171 | SignalSpy { |
|
173 | SignalSpy { | |
172 | id: lineSeriesPointAddedSpy |
|
174 | id: lineSeriesPointAddedSpy | |
173 | target: lineSeries |
|
175 | target: lineSeries | |
174 | signalName: "pointAdded" |
|
176 | signalName: "pointAdded" | |
175 | } |
|
177 | } | |
176 |
|
178 | |||
177 | SignalSpy { |
|
179 | SignalSpy { | |
178 | id: lineSeriesPointReplacedSpy |
|
180 | id: lineSeriesPointReplacedSpy | |
179 | target: lineSeries |
|
181 | target: lineSeries | |
180 | signalName: "pointReplaced" |
|
182 | signalName: "pointReplaced" | |
181 | } |
|
183 | } | |
182 |
|
184 | |||
183 | SignalSpy { |
|
185 | SignalSpy { | |
184 | id: lineSeriesPointsReplacedSpy |
|
186 | id: lineSeriesPointsReplacedSpy | |
185 | target: lineSeries |
|
187 | target: lineSeries | |
186 | signalName: "pointsReplaced" |
|
188 | signalName: "pointsReplaced" | |
187 | } |
|
189 | } | |
188 |
|
190 | |||
189 | SignalSpy { |
|
191 | SignalSpy { | |
190 | id: lineSeriesPointRemovedSpy |
|
192 | id: lineSeriesPointRemovedSpy | |
191 | target: lineSeries |
|
193 | target: lineSeries | |
192 | signalName: "pointRemoved" |
|
194 | signalName: "pointRemoved" | |
193 | } |
|
195 | } | |
194 | } |
|
196 | } | |
195 |
|
197 | |||
196 | AreaSeries { |
|
198 | AreaSeries { | |
197 | id: areaSeries |
|
199 | id: areaSeries | |
198 | name: "area" |
|
200 | name: "area" | |
199 | upperSeries: lineSeries |
|
201 | upperSeries: lineSeries | |
200 | } |
|
202 | } | |
201 |
|
203 | |||
202 | SplineSeries { |
|
204 | SplineSeries { | |
203 | id: splineSeries |
|
205 | id: splineSeries | |
204 | name: "spline" |
|
206 | name: "spline" | |
205 |
|
207 | |||
206 | SignalSpy { |
|
208 | SignalSpy { | |
207 | id: splineSeriesPointAddedSpy |
|
209 | id: splineSeriesPointAddedSpy | |
208 | target: splineSeries |
|
210 | target: splineSeries | |
209 | signalName: "pointAdded" |
|
211 | signalName: "pointAdded" | |
210 | } |
|
212 | } | |
211 |
|
213 | |||
212 | SignalSpy { |
|
214 | SignalSpy { | |
213 | id: splineSeriesPointReplacedSpy |
|
215 | id: splineSeriesPointReplacedSpy | |
214 | target: splineSeries |
|
216 | target: splineSeries | |
215 | signalName: "pointReplaced" |
|
217 | signalName: "pointReplaced" | |
216 | } |
|
218 | } | |
217 |
|
219 | |||
218 | SignalSpy { |
|
220 | SignalSpy { | |
219 | id: splineSeriesPointsReplacedSpy |
|
221 | id: splineSeriesPointsReplacedSpy | |
220 | target: splineSeries |
|
222 | target: splineSeries | |
221 | signalName: "pointsReplaced" |
|
223 | signalName: "pointsReplaced" | |
222 | } |
|
224 | } | |
223 |
|
225 | |||
224 | SignalSpy { |
|
226 | SignalSpy { | |
225 | id: splineSeriesPointRemovedSpy |
|
227 | id: splineSeriesPointRemovedSpy | |
226 | target: splineSeries |
|
228 | target: splineSeries | |
227 | signalName: "pointRemoved" |
|
229 | signalName: "pointRemoved" | |
228 | } |
|
230 | } | |
229 | } |
|
231 | } | |
230 |
|
232 | |||
231 | ScatterSeries { |
|
233 | ScatterSeries { | |
232 | id: scatterSeries |
|
234 | id: scatterSeries | |
233 | name: "scatter" |
|
235 | name: "scatter" | |
234 |
|
236 | |||
235 | SignalSpy { |
|
237 | SignalSpy { | |
236 | id: scatterSeriesPointAddedSpy |
|
238 | id: scatterSeriesPointAddedSpy | |
237 | target: scatterSeries |
|
239 | target: scatterSeries | |
238 | signalName: "pointAdded" |
|
240 | signalName: "pointAdded" | |
239 | } |
|
241 | } | |
240 |
|
242 | |||
241 | SignalSpy { |
|
243 | SignalSpy { | |
242 | id: scatterSeriesPointReplacedSpy |
|
244 | id: scatterSeriesPointReplacedSpy | |
243 | target: scatterSeries |
|
245 | target: scatterSeries | |
244 | signalName: "pointReplaced" |
|
246 | signalName: "pointReplaced" | |
245 | } |
|
247 | } | |
246 |
|
248 | |||
247 | SignalSpy { |
|
249 | SignalSpy { | |
248 | id: scatterSeriesPointsReplacedSpy |
|
250 | id: scatterSeriesPointsReplacedSpy | |
249 | target: scatterSeries |
|
251 | target: scatterSeries | |
250 | signalName: "pointsReplaced" |
|
252 | signalName: "pointsReplaced" | |
251 | } |
|
253 | } | |
252 |
|
254 | |||
253 | SignalSpy { |
|
255 | SignalSpy { | |
254 | id: scatterSeriesPointRemovedSpy |
|
256 | id: scatterSeriesPointRemovedSpy | |
255 | target: scatterSeries |
|
257 | target: scatterSeries | |
256 | signalName: "pointRemoved" |
|
258 | signalName: "pointRemoved" | |
257 | } |
|
259 | } | |
258 | } |
|
260 | } | |
259 | } |
|
261 | } | |
260 | } |
|
262 | } |
General Comments 0
You need to be logged in to leave comments.
Login now