##// END OF EJS Templates
Improving QML chart properties tester usability
Tero Ahola -
r1930:54618a4a89cc
parent child
Show More
@@ -0,0 +1,35
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 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 Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial 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 1.0
22
23 Flow {
24 property variant chart
25 anchors.fill: parent
26 flow: Flow.TopToBottom
27 spacing: 5
28
29 FontEditor {
30 fontDescription: "title"
31 function editedFont() {
32 return chart.titleFont;
33 }
34 }
35 }
@@ -1,99 +1,108
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22
23 23 Item {
24 24 id: chartEditor
25 25 property variant series // TODO: rename to chart
26 onSeriesChanged: loader.item.chart = series;
26 onSeriesChanged: {
27 if (loader.item != undefined)
28 loader.item.chart = series;
29 }
30
31 function selectButton(button) {
32 chartButton.color = "#79bd8f";
33 titleButton.color = "#79bd8f";
34 legendButton.color = "#79bd8f";
35 axisXButton.color = "#79bd8f";
36 axisYButton.color = "#79bd8f";
37 button.color = "#00a388";
38 }
27 39
28 40 Flow {
29 41 id: selectorFlow
30 42 anchors.top: parent.top
31 height: 60
43 height: 90
32 44 anchors.left: parent.left
33 45 anchors.right: parent.right
34 46 spacing: 5
35 47 flow: Flow.TopToBottom
36 48
37 49 Button {
38 50 id: chartButton
39 51 text: "Chart properties"
40 52 unpressedColor: "#79bd8f"
41 53 onClicked: {
42 color = "#00a388";
43 legendButton.color = "#79bd8f";
44 axisXButton.color = "#79bd8f";
45 axisYButton.color = "#79bd8f";
46 loader.source = "ChartEditor1.qml";
54 selectButton(chartButton);
55 loader.source = "ChartEditorProperties.qml";
56 loader.item.chart = series;
57 }
58 }
59 Button {
60 id: titleButton
61 text: "Title properties"
62 unpressedColor: "#79bd8f"
63 onClicked: {
64 selectButton(titleButton);
65 loader.source = "ChartEditorTitle.qml";
47 66 loader.item.chart = series;
48 67 }
49 68 }
50 69 Button {
51 70 id: legendButton
52 71 text: "Legend properties"
53 72 unpressedColor: "#79bd8f"
54 73 onClicked: {
55 color = "#00a388";
56 chartButton.color = "#79bd8f";
57 axisXButton.color = "#79bd8f";
58 axisYButton.color = "#79bd8f";
59 loader.source = "ChartEditor2.qml";
74 selectButton(legendButton);
75 loader.source = "ChartEditorLegend.qml";
60 76 loader.item.chartLegend = series.legend;
61 77 }
62 78 }
63 79 Button {
64 80 id: axisXButton
65 81 text: "Axis X properties"
66 82 unpressedColor: "#79bd8f"
67 83 onClicked: {
68 color = "#00a388";
69 chartButton.color = "#79bd8f";
70 legendButton.color = "#79bd8f";
71 axisYButton.color = "#79bd8f";
72 loader.source = "ChartEditor3.qml";
84 selectButton(axisXButton);
85 loader.source = "ChartEditorAxis.qml";
73 86 loader.item.axis = series.axisX;
74 87 }
75 88 }
76 89 Button {
77 90 id: axisYButton
78 91 text: "Axis Y properties"
79 92 unpressedColor: "#79bd8f"
80 93 onClicked: {
81 color = "#00a388";
82 chartButton.color = "#79bd8f";
83 legendButton.color = "#79bd8f";
84 axisXButton.color = "#79bd8f";
85 loader.source = "ChartEditor3.qml";
94 selectButton(axisYButton);
95 loader.source = "ChartEditorAxis.qml";
86 96 loader.item.axis = series.axisY;
87 97 }
88 98 }
89 99 }
90 100
91 101 Loader {
92 102 id: loader
93 103 anchors.top: selectorFlow.bottom
94 104 anchors.bottom: parent.bottom
95 105 anchors.left: parent.left
96 106 anchors.right: parent.right
97 107 }
98
99 108 }
@@ -1,106 +1,105
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22
23 23 Row {
24 24 anchors.fill: parent
25 25 spacing: 5
26 26 property variant axis
27 27
28 28 Flow {
29 id: flow
30 29 spacing: 5
31 30 flow: Flow.TopToBottom
32 31
33 32 Button {
34 33 text: "axis visible"
35 34 onClicked: axis.visible = !axis.visible;
36 35 }
37 36 Button {
38 37 text: "axis grid visible"
39 38 onClicked: axis.gridVisible = !axis.gridVisible;
40 39 }
41 40 Button {
42 41 text: "axis color"
43 42 onClicked: axis.color = main.nextColor();
44 43 }
45 44 Button {
46 45 text: "axis labels color"
47 46 onClicked: axis.labelsColor = main.nextColor();
48 47 }
49 48 Button {
50 49 text: "axis labels angle +"
51 50 onClicked: axis.labelsAngle += 5;
52 51 }
53 52 Button {
54 53 text: "axis labels angle -"
55 54 onClicked: axis.labelsAngle -= 5;
56 55 }
57 56 Button {
58 57 text: "axis shades visible"
59 58 onClicked: axis.shadesVisible = !axis.shadesVisible;
60 59 }
61 60 Button {
62 61 text: "axis shades color"
63 62 onClicked: axis.shadesColor = main.nextColor();
64 63 }
65 64 Button {
66 65 text: "axis shades bcolor"
67 66 onClicked: axis.shadesBorderColor = main.nextColor();
68 67 }
69 68 Button {
70 69 text: "axis max +"
71 70 onClicked: axis.max += 0.1;
72 71 }
73 72 Button {
74 73 text: "axis max -"
75 74 onClicked: axis.max -= 0.1;
76 75 }
77 76 Button {
78 77 text: "axis min +"
79 78 onClicked: axis.min += 0.1;
80 79 }
81 80 Button {
82 81 text: "axis min -"
83 82 onClicked: axis.min -= 0.1;
84 83 }
85 84 Button {
86 85 text: "axis ticks count +"
87 86 onClicked: axis.ticksCount++;
88 87 }
89 88 Button {
90 89 text: "axis ticks count -"
91 90 onClicked: axis.ticksCount--;
92 91 }
93 92 Button {
94 93 text: "axis nice nmb"
95 94 onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled;
96 95 }
97 96 }
98 97
99 98 FontEditor {
100 99 id: fontEditor
101 100 fontDescription: "axis"
102 101 function editedFont() {
103 102 return axis.labelsFont;
104 103 }
105 104 }
106 105 }
1 NO CONTENT: file renamed from tests/qmlchartproperties/qml/qmlchartproperties/ChartEditor2.qml to tests/qmlchartproperties/qml/qmlchartproperties/ChartEditorLegend.qml
@@ -1,132 +1,120
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22
23 Row {
23 Flow {
24 24 anchors.fill: parent
25 spacing: 5
26 25 property variant chart
27
28 Flow {
29 flow: Flow.TopToBottom
30 spacing: 5
31 Button {
32 text: "visible"
33 onClicked: chart.visible = !chart.visible;
34 }
35 Button {
36 text: "theme +"
37 onClicked: chart.theme++;
38 }
39 Button {
40 text: "theme -"
41 onClicked: chart.theme--;
42 }
43 Button {
44 text: "animation opt +"
45 onClicked: chart.animationOptions++;
46 }
47 Button {
48 text: "animation opt -"
49 onClicked: chart.animationOptions--;
50 }
51 Button {
52 text: "background color"
53 onClicked: chart.backgroundColor = main.nextColor();
54 }
55 Button {
56 text: "drop shadow enabled"
57 onClicked: chart.dropShadowEnabled = !chart.dropShadowEnabled;
58 }
59 Button {
60 text: "zoom +"
61 onClicked: chart.zoom(2);
62 }
63 Button {
64 text: "zoom -"
65 onClicked: chart.zoom(0.5);
66 }
67 Button {
68 text: "scroll left"
69 onClicked: chart.scrollLeft(10);
70 }
71 Button {
72 text: "scroll right"
73 onClicked: chart.scrollRight(10);
74 }
75 Button {
76 text: "scroll up"
77 onClicked: chart.scrollUp(10);
78 }
79 Button {
80 text: "scroll down"
81 onClicked: chart.scrollDown(10);
82 }
83 Button {
84 text: "title color"
85 onClicked: chart.titleColor = main.nextColor();
86 }
87 Button {
88 text: "zoom -"
89 onClicked: chart.zoom(0.5);
90 }
91 Button {
92 text: "top min margin +"
93 onClicked: chart.minimumMargins.top += 5;
94 }
95 Button {
96 text: "top min margin -"
97 onClicked: chart.minimumMargins.top -= 5;
98 }
99 Button {
100 text: "bottom min margin +"
101 onClicked: chart.minimumMargins.bottom += 5;
102 }
103 Button {
104 text: "bottom min margin -"
105 onClicked: chart.minimumMargins.bottom -= 5;
106 }
107 Button {
108 text: "left min margin +"
109 onClicked: chart.minimumMargins.left += 5;
110 }
111 Button {
112 text: "left min margin -"
113 onClicked: chart.minimumMargins.left -= 5;
114 }
115 Button {
116 text: "right min margin +"
117 onClicked: chart.minimumMargins.right += 5;
118 }
119 Button {
120 text: "right min margin -"
121 onClicked: chart.minimumMargins.right -= 5;
122 }
26 flow: Flow.TopToBottom
27 spacing: 5
28 Button {
29 text: "visible"
30 onClicked: chart.visible = !chart.visible;
123 31 }
124
125 FontEditor {
126 id: fontEditor
127 fontDescription: "title"
128 function editedFont() {
129 return chart.titleFont;
130 }
32 Button {
33 text: "theme +"
34 onClicked: chart.theme++;
35 }
36 Button {
37 text: "theme -"
38 onClicked: chart.theme--;
39 }
40 Button {
41 text: "animation opt +"
42 onClicked: chart.animationOptions++;
43 }
44 Button {
45 text: "animation opt -"
46 onClicked: chart.animationOptions--;
47 }
48 Button {
49 text: "background color"
50 onClicked: chart.backgroundColor = main.nextColor();
51 }
52 Button {
53 text: "drop shadow enabled"
54 onClicked: chart.dropShadowEnabled = !chart.dropShadowEnabled;
55 }
56 Button {
57 text: "zoom +"
58 onClicked: chart.zoom(2);
59 }
60 Button {
61 text: "zoom -"
62 onClicked: chart.zoom(0.5);
63 }
64 Button {
65 text: "scroll left"
66 onClicked: chart.scrollLeft(10);
67 }
68 Button {
69 text: "scroll right"
70 onClicked: chart.scrollRight(10);
71 }
72 Button {
73 text: "scroll up"
74 onClicked: chart.scrollUp(10);
75 }
76 Button {
77 text: "scroll down"
78 onClicked: chart.scrollDown(10);
79 }
80 Button {
81 text: "title color"
82 onClicked: chart.titleColor = main.nextColor();
83 }
84 Button {
85 text: "zoom -"
86 onClicked: chart.zoom(0.5);
87 }
88 Button {
89 text: "top min margin +"
90 onClicked: chart.minimumMargins.top += 5;
91 }
92 Button {
93 text: "top min margin -"
94 onClicked: chart.minimumMargins.top -= 5;
95 }
96 Button {
97 text: "bottom min margin +"
98 onClicked: chart.minimumMargins.bottom += 5;
99 }
100 Button {
101 text: "bottom min margin -"
102 onClicked: chart.minimumMargins.bottom -= 5;
103 }
104 Button {
105 text: "left min margin +"
106 onClicked: chart.minimumMargins.left += 5;
107 }
108 Button {
109 text: "left min margin -"
110 onClicked: chart.minimumMargins.left -= 5;
111 }
112 Button {
113 text: "right min margin +"
114 onClicked: chart.minimumMargins.right += 5;
115 }
116 Button {
117 text: "right min margin -"
118 onClicked: chart.minimumMargins.right -= 5;
131 119 }
132 120 }
@@ -1,92 +1,92
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22
23 23 Flow {
24 24 flow: Flow.TopToBottom
25 25 spacing: 5
26 26 property string fontDescription: ""
27 27
28 28 Button {
29 29 text: fontDescription + " bold"
30 30 onClicked: editedFont().bold = !editedFont().bold;
31 31 }
32 32 Button {
33 33 text: fontDescription + " capitalization"
34 34 onClicked: editedFont().capitalization++;
35 35 }
36 36 Button {
37 text: fontDescription + " family"
37 text: fontDescription + " font family"
38 38 onClicked: editedFont().family = "courier";
39 39 }
40 40 Button {
41 41 text: fontDescription + " font italic"
42 42 onClicked: editedFont().italic = !editedFont().italic;
43 43 }
44 44 Button {
45 45 text: fontDescription + " letterSpacing +"
46 46 onClicked: editedFont().letterSpacing++;
47 47 }
48 48 Button {
49 49 text: fontDescription + " letterSpacing -"
50 50 onClicked: editedFont().letterSpacing--;
51 51 }
52 52 Button {
53 53 text: fontDescription + " pixelSize +"
54 54 onClicked: editedFont().pixelSize++;
55 55 }
56 56 Button {
57 57 text: fontDescription + " pixelSize -"
58 58 onClicked: editedFont().pixelSize--;
59 59 }
60 60 Button {
61 61 text: fontDescription + " pointSize +"
62 62 onClicked: editedFont().pointSize++;
63 63 }
64 64 Button {
65 65 text: fontDescription + " pointSize -"
66 66 onClicked: editedFont().pointSize--;
67 67 }
68 68 Button {
69 69 text: fontDescription + " strikeout"
70 70 onClicked: editedFont().strikeout = !editedFont().strikeout;
71 71 }
72 72 Button {
73 73 text: fontDescription + " underline"
74 74 onClicked: editedFont().underline = !editedFont().underline;
75 75 }
76 76 Button {
77 77 text: fontDescription + " weight +"
78 78 onClicked: editedFont().weight++;
79 79 }
80 80 Button {
81 81 text: fontDescription + " weight -"
82 82 onClicked: editedFont().weight--;
83 83 }
84 84 Button {
85 85 text: fontDescription + " wordSpacing +"
86 86 onClicked: editedFont().wordSpacing++;
87 87 }
88 88 Button {
89 89 text: fontDescription + " wordSpacing -"
90 90 onClicked: editedFont().wordSpacing--;
91 91 }
92 92 }
@@ -1,29 +1,30
1 1 <RCC>
2 2 <qresource prefix="/">
3 3 <file>qml/qmlchartproperties/loader.qml</file>
4 4 <file>qml/qmlchartproperties/main.qml</file>
5 5 <file>qml/qmlchartproperties/Button.qml</file>
6 6 <file>qml/qmlchartproperties/PieChart.qml</file>
7 7 <file>qml/qmlchartproperties/PieEditor.qml</file>
8 8 <file>qml/qmlchartproperties/LineChart.qml</file>
9 9 <file>qml/qmlchartproperties/LineEditor.qml</file>
10 10 <file>qml/qmlchartproperties/SplineChart.qml</file>
11 11 <file>qml/qmlchartproperties/ScatterChart.qml</file>
12 12 <file>qml/qmlchartproperties/AreaChart.qml</file>
13 13 <file>qml/qmlchartproperties/BarChart.qml</file>
14 14 <file>qml/qmlchartproperties/BarEditor.qml</file>
15 15 <file>qml/qmlchartproperties/ScatterEditor.qml</file>
16 16 <file>qml/qmlchartproperties/AreaEditor.qml</file>
17 17 <file>qml/qmlchartproperties/StackedBarChart.qml</file>
18 18 <file>qml/qmlchartproperties/PercentBarChart.qml</file>
19 19 <file>qml/qmlchartproperties/Chart.qml</file>
20 20 <file>qml/qmlchartproperties/ChartEditor.qml</file>
21 <file>qml/qmlchartproperties/ChartEditor1.qml</file>
22 <file>qml/qmlchartproperties/ChartEditor2.qml</file>
23 <file>qml/qmlchartproperties/ChartEditor3.qml</file>
24 21 <file>qml/qmlchartproperties/FontEditor.qml</file>
25 22 <file>qml/qmlchartproperties/HorizontalBarChart.qml</file>
26 23 <file>qml/qmlchartproperties/HorizontalPercentBarChart.qml</file>
27 24 <file>qml/qmlchartproperties/HorizontalStackedBarChart.qml</file>
25 <file>qml/qmlchartproperties/ChartEditorAxis.qml</file>
26 <file>qml/qmlchartproperties/ChartEditorLegend.qml</file>
27 <file>qml/qmlchartproperties/ChartEditorProperties.qml</file>
28 <file>qml/qmlchartproperties/ChartEditorTitle.qml</file>
28 29 </qresource>
29 30 </RCC>
General Comments 0
You need to be logged in to leave comments. Login now