@@ -1,863 +1,863 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 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 Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial 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 "tst_qabstractaxis.h" |
|
21 | #include "tst_qabstractaxis.h" | |
22 |
|
22 | |||
23 | Q_DECLARE_METATYPE(QPen) |
|
23 | Q_DECLARE_METATYPE(QPen) | |
24 | Q_DECLARE_METATYPE(Qt::Orientation) |
|
24 | Q_DECLARE_METATYPE(Qt::Orientation) | |
25 |
|
25 | |||
26 | void tst_QAbstractAxis::initTestCase() |
|
26 | void tst_QAbstractAxis::initTestCase() | |
27 | { |
|
27 | { | |
28 | } |
|
28 | } | |
29 |
|
29 | |||
30 | void tst_QAbstractAxis::cleanupTestCase() |
|
30 | void tst_QAbstractAxis::cleanupTestCase() | |
31 | { |
|
31 | { | |
32 | } |
|
32 | } | |
33 |
|
33 | |||
34 | void tst_QAbstractAxis::init(QAbstractAxis* axis, QAbstractSeries* series) |
|
34 | void tst_QAbstractAxis::init(QAbstractAxis* axis, QAbstractSeries* series) | |
35 | { |
|
35 | { | |
36 | m_axis = axis; |
|
36 | m_axis = axis; | |
37 | m_series = series; |
|
37 | m_series = series; | |
38 | m_view = new QChartView(new QChart()); |
|
38 | m_view = new QChartView(new QChart()); | |
39 | m_chart = m_view->chart(); |
|
39 | m_chart = m_view->chart(); | |
40 | } |
|
40 | } | |
41 |
|
41 | |||
42 | void tst_QAbstractAxis::cleanup() |
|
42 | void tst_QAbstractAxis::cleanup() | |
43 | { |
|
43 | { | |
44 | delete m_view; |
|
44 | delete m_view; | |
45 | m_view = 0; |
|
45 | m_view = 0; | |
46 | m_chart = 0; |
|
46 | m_chart = 0; | |
47 | m_axis = 0; |
|
47 | m_axis = 0; | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | void tst_QAbstractAxis::qabstractaxis() |
|
50 | void tst_QAbstractAxis::qabstractaxis() | |
51 | { |
|
51 | { | |
52 | QCOMPARE(m_axis->linePen(), QPen()); |
|
52 | QCOMPARE(m_axis->linePen(), QPen()); | |
53 | //TODO QCOMPARE(m_axis->axisPenColor(), QColor()); |
|
53 | //TODO QCOMPARE(m_axis->axisPenColor(), QColor()); | |
54 | QCOMPARE(m_axis->gridLinePen(), QPen()); |
|
54 | QCOMPARE(m_axis->gridLinePen(), QPen()); | |
55 | QCOMPARE(m_axis->isLineVisible(), true); |
|
55 | QCOMPARE(m_axis->isLineVisible(), true); | |
56 | QCOMPARE(m_axis->isGridLineVisible(), true); |
|
56 | QCOMPARE(m_axis->isGridLineVisible(), true); | |
57 | QCOMPARE(m_axis->isVisible(), true); |
|
57 | QCOMPARE(m_axis->isVisible(), true); | |
58 | QCOMPARE(m_axis->labelsAngle(), 0); |
|
58 | QCOMPARE(m_axis->labelsAngle(), 0); | |
59 | QCOMPARE(m_axis->labelsBrush(), QBrush()); |
|
59 | QCOMPARE(m_axis->labelsBrush(), QBrush()); | |
60 | //TODO QCOMPARE(m_axis->labelsColor(), QColor()); |
|
60 | //TODO QCOMPARE(m_axis->labelsColor(), QColor()); | |
61 | QCOMPARE(m_axis->labelsFont(), QFont()); |
|
61 | QCOMPARE(m_axis->labelsFont(), QFont()); | |
62 | QCOMPARE(m_axis->labelsPen(), QPen()); |
|
62 | QCOMPARE(m_axis->labelsPen(), QPen()); | |
63 | QCOMPARE(m_axis->labelsVisible(), true); |
|
63 | QCOMPARE(m_axis->labelsVisible(), true); | |
64 | QCOMPARE(m_axis->orientation(), Qt::Orientation(0)); |
|
64 | QCOMPARE(m_axis->orientation(), Qt::Orientation(0)); | |
65 | m_axis->setLineVisible(false); |
|
65 | m_axis->setLineVisible(false); | |
66 | m_axis->setLinePen(QPen()); |
|
66 | m_axis->setLinePen(QPen()); | |
67 | m_axis->setLinePenColor(QColor()); |
|
67 | m_axis->setLinePenColor(QColor()); | |
68 | m_axis->setGridLinePen(QPen()); |
|
68 | m_axis->setGridLinePen(QPen()); | |
69 | m_axis->setGridLineVisible(false); |
|
69 | m_axis->setGridLineVisible(false); | |
70 | m_axis->setLabelsAngle(-1); |
|
70 | m_axis->setLabelsAngle(-1); | |
71 | m_axis->setLabelsBrush(QBrush()); |
|
71 | m_axis->setLabelsBrush(QBrush()); | |
72 | m_axis->setLabelsColor(QColor()); |
|
72 | m_axis->setLabelsColor(QColor()); | |
73 | m_axis->setLabelsFont(QFont()); |
|
73 | m_axis->setLabelsFont(QFont()); | |
74 | m_axis->setLabelsPen(QPen()); |
|
74 | m_axis->setLabelsPen(QPen()); | |
75 | m_axis->setLabelsVisible(false); |
|
75 | m_axis->setLabelsVisible(false); | |
76 | m_axis->setMax(QVariant()); |
|
76 | m_axis->setMax(QVariant()); | |
77 | m_axis->setMin(QVariant()); |
|
77 | m_axis->setMin(QVariant()); | |
78 | m_axis->setRange(QVariant(), QVariant()); |
|
78 | m_axis->setRange(QVariant(), QVariant()); | |
79 | m_axis->setShadesBorderColor(QColor()); |
|
79 | m_axis->setShadesBorderColor(QColor()); | |
80 | m_axis->setShadesBrush(QBrush()); |
|
80 | m_axis->setShadesBrush(QBrush()); | |
81 | m_axis->setShadesColor(QColor()); |
|
81 | m_axis->setShadesColor(QColor()); | |
82 | m_axis->setShadesPen(QPen()); |
|
82 | m_axis->setShadesPen(QPen()); | |
83 | m_axis->setShadesVisible(false); |
|
83 | m_axis->setShadesVisible(false); | |
84 | m_axis->setVisible(false); |
|
84 | m_axis->setVisible(false); | |
85 | //TODO QCOMPARE(m_axis->shadesBorderColor(), QColor()); |
|
85 | //TODO QCOMPARE(m_axis->shadesBorderColor(), QColor()); | |
86 | //TODO QCOMPARE(m_axis->shadesBrush(), QBrush()); |
|
86 | //TODO QCOMPARE(m_axis->shadesBrush(), QBrush()); | |
87 | //TODO QCOMPARE(m_axis->shadesColor(), QColor()); |
|
87 | //TODO QCOMPARE(m_axis->shadesColor(), QColor()); | |
88 | QCOMPARE(m_axis->shadesPen(), QPen()); |
|
88 | QCOMPARE(m_axis->shadesPen(), QPen()); | |
89 | QCOMPARE(m_axis->shadesVisible(), false); |
|
89 | QCOMPARE(m_axis->shadesVisible(), false); | |
90 | m_axis->show(); |
|
90 | m_axis->show(); | |
91 | m_axis->hide(); |
|
91 | m_axis->hide(); | |
92 | } |
|
92 | } | |
93 |
|
93 | |||
94 | void tst_QAbstractAxis::axisPen_data() |
|
94 | void tst_QAbstractAxis::axisPen_data() | |
95 | { |
|
95 | { | |
96 | QTest::addColumn<QPen>("axisPen"); |
|
96 | QTest::addColumn<QPen>("axisPen"); | |
97 | QTest::newRow("null") << QPen(); |
|
97 | QTest::newRow("null") << QPen(); | |
98 | QTest::newRow("blue") << QPen(Qt::blue); |
|
98 | QTest::newRow("blue") << QPen(Qt::blue); | |
99 | QTest::newRow("black") << QPen(Qt::black); |
|
99 | QTest::newRow("black") << QPen(Qt::black); | |
100 | QTest::newRow("red") << QPen(Qt::red); |
|
100 | QTest::newRow("red") << QPen(Qt::red); | |
101 | } |
|
101 | } | |
102 |
|
102 | |||
103 | void tst_QAbstractAxis::axisPen() |
|
103 | void tst_QAbstractAxis::axisPen() | |
104 | { |
|
104 | { | |
105 | QFETCH(QPen, axisPen); |
|
105 | QFETCH(QPen, axisPen); | |
106 |
|
106 | |||
107 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
107 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
108 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
108 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
109 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
109 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
110 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
110 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
111 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
111 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
112 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
112 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
113 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
113 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
114 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
114 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
115 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
115 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
116 |
|
116 | |||
117 | m_axis->setLinePen(axisPen); |
|
117 | m_axis->setLinePen(axisPen); | |
118 | QCOMPARE(m_axis->linePen(), axisPen); |
|
118 | QCOMPARE(m_axis->linePen(), axisPen); | |
119 |
|
119 | |||
120 | QCOMPARE(spy0.count(), 0); |
|
120 | QCOMPARE(spy0.count(), 0); | |
121 | QCOMPARE(spy1.count(), 0); |
|
121 | QCOMPARE(spy1.count(), 0); | |
122 | QCOMPARE(spy2.count(), 0); |
|
122 | QCOMPARE(spy2.count(), 0); | |
123 | QCOMPARE(spy3.count(), 0); |
|
123 | QCOMPARE(spy3.count(), 0); | |
124 | QCOMPARE(spy4.count(), 0); |
|
124 | QCOMPARE(spy4.count(), 0); | |
125 | QCOMPARE(spy5.count(), 0); |
|
125 | QCOMPARE(spy5.count(), 0); | |
126 | QCOMPARE(spy6.count(), 0); |
|
126 | QCOMPARE(spy6.count(), 0); | |
127 | QCOMPARE(spy7.count(), 0); |
|
127 | QCOMPARE(spy7.count(), 0); | |
128 | QCOMPARE(spy8.count(), 0); |
|
128 | QCOMPARE(spy8.count(), 0); | |
129 |
|
129 | |||
130 | m_chart->setAxisX(m_axis, m_series); |
|
130 | m_chart->setAxisX(m_axis, m_series); | |
131 | m_view->show(); |
|
131 | m_view->show(); | |
132 | QTest::qWaitForWindowShown(m_view); |
|
132 | QTest::qWaitForWindowShown(m_view); | |
133 | //TODO QCOMPARE(m_axis->axisPen(), axisPen); |
|
133 | //TODO QCOMPARE(m_axis->axisPen(), axisPen); | |
134 | } |
|
134 | } | |
135 |
|
135 | |||
136 | void tst_QAbstractAxis::axisPenColor_data() |
|
136 | void tst_QAbstractAxis::axisPenColor_data() | |
137 | { |
|
137 | { | |
138 | } |
|
138 | } | |
139 |
|
139 | |||
140 | void tst_QAbstractAxis::axisPenColor() |
|
140 | void tst_QAbstractAxis::axisPenColor() | |
141 | { |
|
141 | { | |
142 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
142 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
143 | QSKIP("Test is not implemented. This is deprecated function"); |
|
143 | QSKIP("Test is not implemented. This is deprecated function"); | |
144 | #else |
|
144 | #else | |
145 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); |
|
145 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); | |
146 | #endif |
|
146 | #endif | |
147 | } |
|
147 | } | |
148 |
|
148 | |||
149 | void tst_QAbstractAxis::gridLinePen_data() |
|
149 | void tst_QAbstractAxis::gridLinePen_data() | |
150 | { |
|
150 | { | |
151 |
|
151 | |||
152 | QTest::addColumn<QPen>("gridLinePen"); |
|
152 | QTest::addColumn<QPen>("gridLinePen"); | |
153 | QTest::newRow("null") << QPen(); |
|
153 | QTest::newRow("null") << QPen(); | |
154 | QTest::newRow("blue") << QPen(Qt::blue); |
|
154 | QTest::newRow("blue") << QPen(Qt::blue); | |
155 | QTest::newRow("black") << QPen(Qt::black); |
|
155 | QTest::newRow("black") << QPen(Qt::black); | |
156 | QTest::newRow("red") << QPen(Qt::red); |
|
156 | QTest::newRow("red") << QPen(Qt::red); | |
157 |
|
157 | |||
158 | } |
|
158 | } | |
159 |
|
159 | |||
160 | void tst_QAbstractAxis::gridLinePen() |
|
160 | void tst_QAbstractAxis::gridLinePen() | |
161 | { |
|
161 | { | |
162 | QFETCH(QPen, gridLinePen); |
|
162 | QFETCH(QPen, gridLinePen); | |
163 |
|
163 | |||
164 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
164 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
165 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
165 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
166 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
166 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
167 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
167 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
168 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
168 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
169 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
169 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
170 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
170 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
171 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
171 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
172 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
172 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
173 |
|
173 | |||
174 | m_axis->setGridLinePen(gridLinePen); |
|
174 | m_axis->setGridLinePen(gridLinePen); | |
175 | QCOMPARE(m_axis->gridLinePen(), gridLinePen); |
|
175 | QCOMPARE(m_axis->gridLinePen(), gridLinePen); | |
176 |
|
176 | |||
177 | QCOMPARE(spy0.count(), 0); |
|
177 | QCOMPARE(spy0.count(), 0); | |
178 | QCOMPARE(spy1.count(), 0); |
|
178 | QCOMPARE(spy1.count(), 0); | |
179 | QCOMPARE(spy2.count(), 0); |
|
179 | QCOMPARE(spy2.count(), 0); | |
180 | QCOMPARE(spy3.count(), 0); |
|
180 | QCOMPARE(spy3.count(), 0); | |
181 | QCOMPARE(spy4.count(), 0); |
|
181 | QCOMPARE(spy4.count(), 0); | |
182 | QCOMPARE(spy5.count(), 0); |
|
182 | QCOMPARE(spy5.count(), 0); | |
183 | QCOMPARE(spy6.count(), 0); |
|
183 | QCOMPARE(spy6.count(), 0); | |
184 | QCOMPARE(spy7.count(), 0); |
|
184 | QCOMPARE(spy7.count(), 0); | |
185 | QCOMPARE(spy8.count(), 0); |
|
185 | QCOMPARE(spy8.count(), 0); | |
186 |
|
186 | |||
187 | m_chart->setAxisX(m_axis, m_series); |
|
187 | m_chart->setAxisX(m_axis, m_series); | |
188 | m_view->show(); |
|
188 | m_view->show(); | |
189 | QTest::qWaitForWindowShown(m_view); |
|
189 | QTest::qWaitForWindowShown(m_view); | |
190 | //TODO QCOMPARE(m_axis->gridLinePen(), gridLinePen); |
|
190 | //TODO QCOMPARE(m_axis->gridLinePen(), gridLinePen); | |
191 | } |
|
191 | } | |
192 |
|
192 | |||
193 | void tst_QAbstractAxis::lineVisible_data() |
|
193 | void tst_QAbstractAxis::lineVisible_data() | |
194 | { |
|
194 | { | |
195 | QTest::addColumn<bool>("lineVisible"); |
|
195 | QTest::addColumn<bool>("lineVisible"); | |
196 | QTest::newRow("true") << true; |
|
196 | QTest::newRow("true") << true; | |
197 | QTest::newRow("false") << false; |
|
197 | QTest::newRow("false") << false; | |
198 | } |
|
198 | } | |
199 |
|
199 | |||
200 | void tst_QAbstractAxis::lineVisible() |
|
200 | void tst_QAbstractAxis::lineVisible() | |
201 | { |
|
201 | { | |
202 | QFETCH(bool, lineVisible); |
|
202 | QFETCH(bool, lineVisible); | |
203 |
|
203 | |||
204 | m_axis->setLineVisible(!lineVisible); |
|
204 | m_axis->setLineVisible(!lineVisible); | |
205 |
|
205 | |||
206 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
206 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
207 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
207 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
208 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
208 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
209 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
209 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
210 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
210 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
211 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
211 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
212 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
212 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
213 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
213 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
214 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
214 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
215 |
|
215 | |||
216 | m_axis->setLineVisible(lineVisible); |
|
216 | m_axis->setLineVisible(lineVisible); | |
217 | QCOMPARE(m_axis->isLineVisible(), lineVisible); |
|
217 | QCOMPARE(m_axis->isLineVisible(), lineVisible); | |
218 |
|
218 | |||
219 | QCOMPARE(spy0.count(), 1); |
|
219 | QCOMPARE(spy0.count(), 1); | |
220 | QCOMPARE(spy1.count(), 0); |
|
220 | QCOMPARE(spy1.count(), 0); | |
221 | QCOMPARE(spy2.count(), 0); |
|
221 | QCOMPARE(spy2.count(), 0); | |
222 | QCOMPARE(spy3.count(), 0); |
|
222 | QCOMPARE(spy3.count(), 0); | |
223 | QCOMPARE(spy4.count(), 0); |
|
223 | QCOMPARE(spy4.count(), 0); | |
224 | QCOMPARE(spy5.count(), 0); |
|
224 | QCOMPARE(spy5.count(), 0); | |
225 | QCOMPARE(spy6.count(), 0); |
|
225 | QCOMPARE(spy6.count(), 0); | |
226 | QCOMPARE(spy7.count(), 0); |
|
226 | QCOMPARE(spy7.count(), 0); | |
227 | QCOMPARE(spy8.count(), 0); |
|
227 | QCOMPARE(spy8.count(), 0); | |
228 |
|
228 | |||
229 | m_chart->setAxisX(m_axis, m_series); |
|
229 | m_chart->setAxisX(m_axis, m_series); | |
230 | m_view->show(); |
|
230 | m_view->show(); | |
231 | QTest::qWaitForWindowShown(m_view); |
|
231 | QTest::qWaitForWindowShown(m_view); | |
232 | QCOMPARE(m_axis->isLineVisible(), lineVisible); |
|
232 | QCOMPARE(m_axis->isLineVisible(), lineVisible); | |
233 | } |
|
233 | } | |
234 |
|
234 | |||
235 | void tst_QAbstractAxis::gridLineVisible_data() |
|
235 | void tst_QAbstractAxis::gridLineVisible_data() | |
236 | { |
|
236 | { | |
237 | QTest::addColumn<bool>("gridLineVisible"); |
|
237 | QTest::addColumn<bool>("gridLineVisible"); | |
238 | QTest::newRow("true") << true; |
|
238 | QTest::newRow("true") << true; | |
239 | QTest::newRow("false") << false; |
|
239 | QTest::newRow("false") << false; | |
240 | } |
|
240 | } | |
241 |
|
241 | |||
242 | void tst_QAbstractAxis::gridLineVisible() |
|
242 | void tst_QAbstractAxis::gridLineVisible() | |
243 | { |
|
243 | { | |
244 | QFETCH(bool, gridLineVisible); |
|
244 | QFETCH(bool, gridLineVisible); | |
245 |
|
245 | |||
246 | m_axis->setGridLineVisible(!gridLineVisible); |
|
246 | m_axis->setGridLineVisible(!gridLineVisible); | |
247 |
|
247 | |||
248 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
248 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
249 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
249 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
250 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
250 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
251 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
251 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
252 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
252 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
253 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
253 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
254 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
254 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
255 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
255 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
256 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
256 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
257 |
|
257 | |||
258 | m_axis->setGridLineVisible(gridLineVisible); |
|
258 | m_axis->setGridLineVisible(gridLineVisible); | |
259 | QCOMPARE(m_axis->isGridLineVisible(), gridLineVisible); |
|
259 | QCOMPARE(m_axis->isGridLineVisible(), gridLineVisible); | |
260 |
|
260 | |||
261 | QCOMPARE(spy0.count(), 0); |
|
261 | QCOMPARE(spy0.count(), 0); | |
262 | QCOMPARE(spy1.count(), 0); |
|
262 | QCOMPARE(spy1.count(), 0); | |
263 | QCOMPARE(spy2.count(), 1); |
|
263 | QCOMPARE(spy2.count(), 1); | |
264 | QCOMPARE(spy3.count(), 0); |
|
264 | QCOMPARE(spy3.count(), 0); | |
265 | QCOMPARE(spy4.count(), 0); |
|
265 | QCOMPARE(spy4.count(), 0); | |
266 | QCOMPARE(spy5.count(), 0); |
|
266 | QCOMPARE(spy5.count(), 0); | |
267 | QCOMPARE(spy6.count(), 0); |
|
267 | QCOMPARE(spy6.count(), 0); | |
268 | QCOMPARE(spy7.count(), 0); |
|
268 | QCOMPARE(spy7.count(), 0); | |
269 | QCOMPARE(spy8.count(), 0); |
|
269 | QCOMPARE(spy8.count(), 0); | |
270 |
|
270 | |||
271 | m_chart->setAxisX(m_axis, m_series); |
|
271 | m_chart->setAxisX(m_axis, m_series); | |
272 | m_view->show(); |
|
272 | m_view->show(); | |
273 | QTest::qWaitForWindowShown(m_view); |
|
273 | QTest::qWaitForWindowShown(m_view); | |
274 | QCOMPARE(m_axis->isGridLineVisible(), gridLineVisible); |
|
274 | QCOMPARE(m_axis->isGridLineVisible(), gridLineVisible); | |
275 |
|
275 | |||
276 | } |
|
276 | } | |
277 |
|
277 | |||
278 | void tst_QAbstractAxis::visible_data() |
|
278 | void tst_QAbstractAxis::visible_data() | |
279 | { |
|
279 | { | |
280 | QTest::addColumn<bool>("visible"); |
|
280 | QTest::addColumn<bool>("visible"); | |
281 | QTest::newRow("true") << true; |
|
281 | QTest::newRow("true") << true; | |
282 | QTest::newRow("false") << false; |
|
282 | QTest::newRow("false") << false; | |
283 | } |
|
283 | } | |
284 |
|
284 | |||
285 | void tst_QAbstractAxis::visible() |
|
285 | void tst_QAbstractAxis::visible() | |
286 | { |
|
286 | { | |
287 | QFETCH(bool, visible); |
|
287 | QFETCH(bool, visible); | |
288 |
|
288 | |||
289 | m_axis->setVisible(!visible); |
|
289 | m_axis->setVisible(!visible); | |
290 |
|
290 | |||
291 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
291 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
292 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
292 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
293 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
293 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
294 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
294 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
295 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
295 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
296 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
296 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
297 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
297 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
298 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
298 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
299 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
299 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
300 |
|
300 | |||
301 | m_axis->setVisible(visible); |
|
301 | m_axis->setVisible(visible); | |
302 | QCOMPARE(m_axis->isVisible(), visible); |
|
302 | QCOMPARE(m_axis->isVisible(), visible); | |
303 |
|
303 | |||
304 | QCOMPARE(spy0.count(), 0); |
|
304 | QCOMPARE(spy0.count(), 0); | |
305 | QCOMPARE(spy1.count(), 0); |
|
305 | QCOMPARE(spy1.count(), 0); | |
306 | QCOMPARE(spy2.count(), 0); |
|
306 | QCOMPARE(spy2.count(), 0); | |
307 | QCOMPARE(spy3.count(), 0); |
|
307 | QCOMPARE(spy3.count(), 0); | |
308 | QCOMPARE(spy4.count(), 0); |
|
308 | QCOMPARE(spy4.count(), 0); | |
309 | QCOMPARE(spy5.count(), 0); |
|
309 | QCOMPARE(spy5.count(), 0); | |
310 | QCOMPARE(spy6.count(), 0); |
|
310 | QCOMPARE(spy6.count(), 0); | |
311 | QCOMPARE(spy7.count(), 0); |
|
311 | QCOMPARE(spy7.count(), 0); | |
312 | QCOMPARE(spy8.count(), 1); |
|
312 | QCOMPARE(spy8.count(), 1); | |
313 |
|
313 | |||
314 | m_chart->setAxisX(m_axis, m_series); |
|
314 | m_chart->setAxisX(m_axis, m_series); | |
315 | m_view->show(); |
|
315 | m_view->show(); | |
316 | QTest::qWaitForWindowShown(m_view); |
|
316 | QTest::qWaitForWindowShown(m_view); | |
317 | QCOMPARE(m_axis->isVisible(), visible); |
|
317 | QCOMPARE(m_axis->isVisible(), visible); | |
318 | } |
|
318 | } | |
319 |
|
319 | |||
320 | void tst_QAbstractAxis::labelsAngle_data() |
|
320 | void tst_QAbstractAxis::labelsAngle_data() | |
321 | { |
|
321 | { | |
322 | QTest::addColumn<int>("labelsAngle"); |
|
322 | QTest::addColumn<int>("labelsAngle"); | |
323 | QTest::newRow("0") << 0; |
|
323 | QTest::newRow("0") << 0; | |
324 | QTest::newRow("45") << 45; |
|
324 | QTest::newRow("45") << 45; | |
325 | QTest::newRow("90") << 90; |
|
325 | QTest::newRow("90") << 90; | |
326 | } |
|
326 | } | |
327 |
|
327 | |||
328 | void tst_QAbstractAxis::labelsAngle() |
|
328 | void tst_QAbstractAxis::labelsAngle() | |
329 | { |
|
329 | { | |
330 | QFETCH(int, labelsAngle); |
|
330 | QFETCH(int, labelsAngle); | |
331 |
|
331 | |||
332 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
332 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
333 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
333 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
334 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
334 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
335 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
335 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
336 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
336 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
337 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
337 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
338 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
338 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
339 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
339 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
340 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
340 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
341 |
|
341 | |||
342 | m_axis->setLabelsAngle(labelsAngle); |
|
342 | m_axis->setLabelsAngle(labelsAngle); | |
343 | QCOMPARE(m_axis->labelsAngle(), labelsAngle); |
|
343 | QCOMPARE(m_axis->labelsAngle(), labelsAngle); | |
344 |
|
344 | |||
345 | QCOMPARE(spy0.count(), 0); |
|
345 | QCOMPARE(spy0.count(), 0); | |
346 | QCOMPARE(spy1.count(), 0); |
|
346 | QCOMPARE(spy1.count(), 0); | |
347 | QCOMPARE(spy2.count(), 0); |
|
347 | QCOMPARE(spy2.count(), 0); | |
348 | QCOMPARE(spy3.count(), 0); |
|
348 | QCOMPARE(spy3.count(), 0); | |
349 | QCOMPARE(spy4.count(), 0); |
|
349 | QCOMPARE(spy4.count(), 0); | |
350 | QCOMPARE(spy5.count(), 0); |
|
350 | QCOMPARE(spy5.count(), 0); | |
351 | QCOMPARE(spy6.count(), 0); |
|
351 | QCOMPARE(spy6.count(), 0); | |
352 | QCOMPARE(spy7.count(), 0); |
|
352 | QCOMPARE(spy7.count(), 0); | |
353 | QCOMPARE(spy8.count(), 0); |
|
353 | QCOMPARE(spy8.count(), 0); | |
354 |
|
354 | |||
355 | m_chart->setAxisX(m_axis, m_series); |
|
355 | m_chart->setAxisX(m_axis, m_series); | |
356 | m_view->show(); |
|
356 | m_view->show(); | |
357 | QTest::qWaitForWindowShown(m_view); |
|
357 | QTest::qWaitForWindowShown(m_view); | |
358 | QCOMPARE(m_axis->labelsAngle(), labelsAngle); |
|
358 | QCOMPARE(m_axis->labelsAngle(), labelsAngle); | |
359 | } |
|
359 | } | |
360 |
|
360 | |||
361 | void tst_QAbstractAxis::labelsBrush_data() |
|
361 | void tst_QAbstractAxis::labelsBrush_data() | |
362 | { |
|
362 | { | |
363 | QTest::addColumn<QBrush>("labelsBrush"); |
|
363 | QTest::addColumn<QBrush>("labelsBrush"); | |
364 | QTest::newRow("null") << QBrush(); |
|
364 | QTest::newRow("null") << QBrush(); | |
365 | QTest::newRow("blue") << QBrush(Qt::blue); |
|
365 | QTest::newRow("blue") << QBrush(Qt::blue); | |
366 | QTest::newRow("black") << QBrush(Qt::black); |
|
366 | QTest::newRow("black") << QBrush(Qt::black); | |
367 |
|
367 | |||
368 | } |
|
368 | } | |
369 |
|
369 | |||
370 | void tst_QAbstractAxis::labelsBrush() |
|
370 | void tst_QAbstractAxis::labelsBrush() | |
371 | { |
|
371 | { | |
372 |
|
372 | |||
373 | QFETCH(QBrush, labelsBrush); |
|
373 | QFETCH(QBrush, labelsBrush); | |
374 |
|
374 | |||
375 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
375 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
376 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
376 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
377 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
377 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
378 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
378 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
379 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
379 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
380 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
380 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
381 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
381 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
382 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
382 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
383 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
383 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
384 |
|
384 | |||
385 | m_axis->setLabelsBrush(labelsBrush); |
|
385 | m_axis->setLabelsBrush(labelsBrush); | |
386 | QCOMPARE(m_axis->labelsBrush(), labelsBrush); |
|
386 | QCOMPARE(m_axis->labelsBrush(), labelsBrush); | |
387 |
|
387 | |||
388 | QCOMPARE(spy0.count(), 0); |
|
388 | QCOMPARE(spy0.count(), 0); | |
389 | QCOMPARE(spy1.count(), 0); |
|
389 | QCOMPARE(spy1.count(), 0); | |
390 | QCOMPARE(spy2.count(), 0); |
|
390 | QCOMPARE(spy2.count(), 0); | |
391 | QCOMPARE(spy3.count(), 0); |
|
391 | QCOMPARE(spy3.count(), 0); | |
392 | QCOMPARE(spy4.count(), 0); |
|
392 | QCOMPARE(spy4.count(), 0); | |
393 | QCOMPARE(spy5.count(), 0); |
|
393 | QCOMPARE(spy5.count(), 0); | |
394 | //TODO QCOMPARE(spy6.count(), 0); |
|
394 | //TODO QCOMPARE(spy6.count(), 0); | |
395 | QCOMPARE(spy7.count(), 0); |
|
395 | QCOMPARE(spy7.count(), 0); | |
396 | QCOMPARE(spy8.count(), 0); |
|
396 | QCOMPARE(spy8.count(), 0); | |
397 |
|
397 | |||
398 | m_view->show(); |
|
398 | m_view->show(); | |
399 | QTest::qWaitForWindowShown(m_view); |
|
399 | QTest::qWaitForWindowShown(m_view); | |
400 | QCOMPARE(m_axis->labelsBrush(), labelsBrush); |
|
400 | QCOMPARE(m_axis->labelsBrush(), labelsBrush); | |
401 |
|
401 | |||
402 | } |
|
402 | } | |
403 |
|
403 | |||
404 | void tst_QAbstractAxis::labelsColor_data() |
|
404 | void tst_QAbstractAxis::labelsColor_data() | |
405 | { |
|
405 | { | |
406 |
|
406 | |||
407 | } |
|
407 | } | |
408 |
|
408 | |||
409 | void tst_QAbstractAxis::labelsColor() |
|
409 | void tst_QAbstractAxis::labelsColor() | |
410 | { |
|
410 | { | |
411 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
411 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
412 | QSKIP("Test is not implemented. This is deprecated function"); |
|
412 | QSKIP("Test is not implemented. This is deprecated function"); | |
413 | #else |
|
413 | #else | |
414 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); |
|
414 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); | |
415 | #endif |
|
415 | #endif | |
416 | } |
|
416 | } | |
417 |
|
417 | |||
418 | void tst_QAbstractAxis::labelsFont_data() |
|
418 | void tst_QAbstractAxis::labelsFont_data() | |
419 | { |
|
419 | { | |
420 | QTest::addColumn<QFont>("labelsFont"); |
|
420 | QTest::addColumn<QFont>("labelsFont"); | |
421 | QTest::newRow("null") << QFont(); |
|
421 | QTest::newRow("null") << QFont(); | |
422 | QTest::newRow("serif") << QFont("SansSerif"); |
|
422 | QTest::newRow("serif") << QFont("SansSerif"); | |
423 | } |
|
423 | } | |
424 |
|
424 | |||
425 | void tst_QAbstractAxis::labelsFont() |
|
425 | void tst_QAbstractAxis::labelsFont() | |
426 | { |
|
426 | { | |
427 |
|
427 | |||
428 | QFETCH(QFont, labelsFont); |
|
428 | QFETCH(QFont, labelsFont); | |
429 |
|
429 | |||
430 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
430 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
431 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
431 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
432 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
432 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
433 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
433 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
434 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
434 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
435 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
435 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
436 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
436 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
437 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
437 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
438 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
438 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
439 |
|
439 | |||
440 | m_axis->setLabelsFont(labelsFont); |
|
440 | m_axis->setLabelsFont(labelsFont); | |
441 | QCOMPARE(m_axis->labelsFont(), labelsFont); |
|
441 | QCOMPARE(m_axis->labelsFont(), labelsFont); | |
442 |
|
442 | |||
443 | QCOMPARE(spy0.count(), 0); |
|
443 | QCOMPARE(spy0.count(), 0); | |
444 | QCOMPARE(spy1.count(), 0); |
|
444 | QCOMPARE(spy1.count(), 0); | |
445 | QCOMPARE(spy2.count(), 0); |
|
445 | QCOMPARE(spy2.count(), 0); | |
446 | QCOMPARE(spy3.count(), 0); |
|
446 | QCOMPARE(spy3.count(), 0); | |
447 | QCOMPARE(spy4.count(), 0); |
|
447 | QCOMPARE(spy4.count(), 0); | |
448 | QCOMPARE(spy5.count(), 0); |
|
448 | QCOMPARE(spy5.count(), 0); | |
449 | QCOMPARE(spy6.count(), 0); |
|
449 | QCOMPARE(spy6.count(), 0); | |
450 | QCOMPARE(spy7.count(), 0); |
|
450 | QCOMPARE(spy7.count(), 0); | |
451 | QCOMPARE(spy8.count(), 0); |
|
451 | QCOMPARE(spy8.count(), 0); | |
452 |
|
452 | |||
453 | m_view->show(); |
|
453 | m_view->show(); | |
454 | QTest::qWaitForWindowShown(m_view); |
|
454 | QTest::qWaitForWindowShown(m_view); | |
455 | QCOMPARE(m_axis->labelsFont(), labelsFont); |
|
455 | QCOMPARE(m_axis->labelsFont(), labelsFont); | |
456 |
|
456 | |||
457 | } |
|
457 | } | |
458 |
|
458 | |||
459 | void tst_QAbstractAxis::labelsPen_data() |
|
459 | void tst_QAbstractAxis::labelsPen_data() | |
460 | { |
|
460 | { | |
461 | QTest::addColumn<QPen>("labelsPen"); |
|
461 | QTest::addColumn<QPen>("labelsPen"); | |
462 | QTest::newRow("null") << QPen(); |
|
462 | QTest::newRow("null") << QPen(); | |
463 | QTest::newRow("blue") << QPen(Qt::blue); |
|
463 | QTest::newRow("blue") << QPen(Qt::blue); | |
464 | QTest::newRow("black") << QPen(Qt::black); |
|
464 | QTest::newRow("black") << QPen(Qt::black); | |
465 | QTest::newRow("red") << QPen(Qt::red); |
|
465 | QTest::newRow("red") << QPen(Qt::red); | |
466 | } |
|
466 | } | |
467 |
|
467 | |||
468 | void tst_QAbstractAxis::labelsPen() |
|
468 | void tst_QAbstractAxis::labelsPen() | |
469 | { |
|
469 | { | |
470 | QFETCH(QPen, labelsPen); |
|
470 | QFETCH(QPen, labelsPen); | |
471 |
|
471 | |||
472 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
472 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
473 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
473 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
474 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
474 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
475 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
475 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
476 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
476 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
477 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
477 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
478 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
478 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
479 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
479 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
480 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
480 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
481 |
|
481 | |||
482 | m_axis->setLabelsPen(labelsPen); |
|
482 | m_axis->setLabelsPen(labelsPen); | |
483 | QCOMPARE(m_axis->labelsPen(), labelsPen); |
|
483 | QCOMPARE(m_axis->labelsPen(), labelsPen); | |
484 |
|
484 | |||
485 | QCOMPARE(spy0.count(), 0); |
|
485 | QCOMPARE(spy0.count(), 0); | |
486 | QCOMPARE(spy1.count(), 0); |
|
486 | QCOMPARE(spy1.count(), 0); | |
487 | QCOMPARE(spy2.count(), 0); |
|
487 | QCOMPARE(spy2.count(), 0); | |
488 | QCOMPARE(spy3.count(), 0); |
|
488 | QCOMPARE(spy3.count(), 0); | |
489 | QCOMPARE(spy4.count(), 0); |
|
489 | QCOMPARE(spy4.count(), 0); | |
490 | QCOMPARE(spy5.count(), 0); |
|
490 | QCOMPARE(spy5.count(), 0); | |
491 | QCOMPARE(spy6.count(), 0); |
|
491 | QCOMPARE(spy6.count(), 0); | |
492 | QCOMPARE(spy7.count(), 0); |
|
492 | QCOMPARE(spy7.count(), 0); | |
493 | QCOMPARE(spy8.count(), 0); |
|
493 | QCOMPARE(spy8.count(), 0); | |
494 |
|
494 | |||
495 | m_chart->setAxisX(m_axis, m_series); |
|
495 | m_chart->setAxisX(m_axis, m_series); | |
496 | m_view->show(); |
|
496 | m_view->show(); | |
497 | QTest::qWaitForWindowShown(m_view); |
|
497 | QTest::qWaitForWindowShown(m_view); | |
498 | //TODO QCOMPARE(m_axis->labelsPen(), labelsPen); |
|
498 | //TODO QCOMPARE(m_axis->labelsPen(), labelsPen); | |
499 | } |
|
499 | } | |
500 |
|
500 | |||
501 | void tst_QAbstractAxis::labelsVisible_data() |
|
501 | void tst_QAbstractAxis::labelsVisible_data() | |
502 | { |
|
502 | { | |
503 | QTest::addColumn<bool>("labelsVisible"); |
|
503 | QTest::addColumn<bool>("labelsVisible"); | |
504 | QTest::newRow("true") << true; |
|
504 | QTest::newRow("true") << true; | |
505 | QTest::newRow("false") << false; |
|
505 | QTest::newRow("false") << false; | |
506 | } |
|
506 | } | |
507 |
|
507 | |||
508 | void tst_QAbstractAxis::labelsVisible() |
|
508 | void tst_QAbstractAxis::labelsVisible() | |
509 | { |
|
509 | { | |
510 | QFETCH(bool, labelsVisible); |
|
510 | QFETCH(bool, labelsVisible); | |
511 |
|
511 | |||
512 | m_axis->setLabelsVisible(!labelsVisible); |
|
512 | m_axis->setLabelsVisible(!labelsVisible); | |
513 |
|
513 | |||
514 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
514 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
515 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
515 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
516 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
516 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
517 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
517 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
518 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
518 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
519 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
519 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
520 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
520 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
521 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
521 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
522 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
522 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
523 |
|
523 | |||
524 | m_axis->setLabelsVisible(labelsVisible); |
|
524 | m_axis->setLabelsVisible(labelsVisible); | |
525 | QCOMPARE(m_axis->labelsVisible(), labelsVisible); |
|
525 | QCOMPARE(m_axis->labelsVisible(), labelsVisible); | |
526 |
|
526 | |||
527 | QCOMPARE(spy0.count(), 0); |
|
527 | QCOMPARE(spy0.count(), 0); | |
528 | QCOMPARE(spy1.count(), 0); |
|
528 | QCOMPARE(spy1.count(), 0); | |
529 | QCOMPARE(spy2.count(), 0); |
|
529 | QCOMPARE(spy2.count(), 0); | |
530 | QCOMPARE(spy3.count(), 0); |
|
530 | QCOMPARE(spy3.count(), 0); | |
531 | QCOMPARE(spy4.count(), 1); |
|
531 | QCOMPARE(spy4.count(), 1); | |
532 | QCOMPARE(spy5.count(), 0); |
|
532 | QCOMPARE(spy5.count(), 0); | |
533 | QCOMPARE(spy6.count(), 0); |
|
533 | QCOMPARE(spy6.count(), 0); | |
534 | QCOMPARE(spy7.count(), 0); |
|
534 | QCOMPARE(spy7.count(), 0); | |
535 | QCOMPARE(spy8.count(), 0); |
|
535 | QCOMPARE(spy8.count(), 0); | |
536 |
|
536 | |||
537 | m_chart->setAxisX(m_axis, m_series); |
|
537 | m_chart->setAxisX(m_axis, m_series); | |
538 | m_view->show(); |
|
538 | m_view->show(); | |
539 | QTest::qWaitForWindowShown(m_view); |
|
539 | QTest::qWaitForWindowShown(m_view); | |
540 | QCOMPARE(m_axis->labelsVisible(), labelsVisible); |
|
540 | QCOMPARE(m_axis->labelsVisible(), labelsVisible); | |
541 | } |
|
541 | } | |
542 |
|
542 | |||
543 | void tst_QAbstractAxis::orientation_data() |
|
543 | void tst_QAbstractAxis::orientation_data() | |
544 | { |
|
544 | { | |
545 | QTest::addColumn<Qt::Orientation>("orientation"); |
|
545 | QTest::addColumn<Qt::Orientation>("orientation"); | |
546 | QTest::newRow("Vertical") << Qt::Vertical; |
|
546 | QTest::newRow("Vertical") << Qt::Vertical; | |
547 | QTest::newRow("Horizontal") << Qt::Horizontal; |
|
547 | QTest::newRow("Horizontal") << Qt::Horizontal; | |
548 | } |
|
548 | } | |
549 |
|
549 | |||
550 | void tst_QAbstractAxis::orientation() |
|
550 | void tst_QAbstractAxis::orientation() | |
551 | { |
|
551 | { | |
552 | QFETCH(Qt::Orientation, orientation); |
|
552 | QFETCH(Qt::Orientation, orientation); | |
553 |
|
553 | |||
554 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
554 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
555 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
555 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
556 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
556 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
557 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
557 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
558 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
558 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
559 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
559 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
560 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
560 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
561 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
561 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
562 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
562 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
563 |
|
563 | |||
564 | if(orientation==Qt::Vertical){ |
|
564 | if(orientation==Qt::Vertical){ | |
565 | m_chart->setAxisY(m_axis,m_series); |
|
565 | m_chart->setAxisY(m_axis,m_series); | |
566 | }else{ |
|
566 | }else{ | |
567 | m_chart->setAxisX(m_axis,m_series); |
|
567 | m_chart->setAxisX(m_axis,m_series); | |
568 | } |
|
568 | } | |
569 | QCOMPARE(m_axis->orientation(), orientation); |
|
569 | QCOMPARE(m_axis->orientation(), orientation); | |
570 |
|
570 | |||
571 | QCOMPARE(spy0.count(), 0); |
|
571 | QCOMPARE(spy0.count(), 0); | |
572 | QCOMPARE(spy1.count(), 0); |
|
572 | QCOMPARE(spy1.count(), 0); | |
573 | QCOMPARE(spy2.count(), 0); |
|
573 | QCOMPARE(spy2.count(), 0); | |
574 | QCOMPARE(spy3.count(), 0); |
|
574 | QCOMPARE(spy3.count(), 0); | |
575 | QCOMPARE(spy4.count(), 0); |
|
575 | QCOMPARE(spy4.count(), 0); | |
576 | QCOMPARE(spy5.count(), 0); |
|
576 | QCOMPARE(spy5.count(), 0); | |
577 | QCOMPARE(spy6.count(), 0); |
|
577 | QCOMPARE(spy6.count(), 0); | |
578 | QCOMPARE(spy7.count(), 0); |
|
578 | QCOMPARE(spy7.count(), 0); | |
579 |
QCOMPARE(spy8.count(), |
|
579 | QCOMPARE(spy8.count(), 0); | |
580 |
|
580 | |||
581 | m_view->show(); |
|
581 | m_view->show(); | |
582 | QTest::qWaitForWindowShown(m_view); |
|
582 | QTest::qWaitForWindowShown(m_view); | |
583 | QCOMPARE(m_axis->orientation(), orientation); |
|
583 | QCOMPARE(m_axis->orientation(), orientation); | |
584 | } |
|
584 | } | |
585 |
|
585 | |||
586 | void tst_QAbstractAxis::setMax_data() |
|
586 | void tst_QAbstractAxis::setMax_data() | |
587 | { |
|
587 | { | |
588 | //just check if it does not crash |
|
588 | //just check if it does not crash | |
589 | QTest::addColumn<QVariant>("max"); |
|
589 | QTest::addColumn<QVariant>("max"); | |
590 | QTest::newRow("something") << QVariant("something"); |
|
590 | QTest::newRow("something") << QVariant("something"); | |
591 | QTest::newRow("1.0") << QVariant(1.0); |
|
591 | QTest::newRow("1.0") << QVariant(1.0); | |
592 | } |
|
592 | } | |
593 |
|
593 | |||
594 | void tst_QAbstractAxis::setMax() |
|
594 | void tst_QAbstractAxis::setMax() | |
595 | { |
|
595 | { | |
596 | QFETCH(QVariant, max); |
|
596 | QFETCH(QVariant, max); | |
597 | m_axis->setMax(max); |
|
597 | m_axis->setMax(max); | |
598 | } |
|
598 | } | |
599 |
|
599 | |||
600 | void tst_QAbstractAxis::setMin_data() |
|
600 | void tst_QAbstractAxis::setMin_data() | |
601 | { |
|
601 | { | |
602 | //just check if it does not crash |
|
602 | //just check if it does not crash | |
603 | QTest::addColumn<QVariant>("min"); |
|
603 | QTest::addColumn<QVariant>("min"); | |
604 | QTest::newRow("something") << QVariant("something"); |
|
604 | QTest::newRow("something") << QVariant("something"); | |
605 | QTest::newRow("1.0") << QVariant(1.0); |
|
605 | QTest::newRow("1.0") << QVariant(1.0); | |
606 | } |
|
606 | } | |
607 |
|
607 | |||
608 | // public void setMin(QVariant const& min) |
|
608 | // public void setMin(QVariant const& min) | |
609 | void tst_QAbstractAxis::setMin() |
|
609 | void tst_QAbstractAxis::setMin() | |
610 | { |
|
610 | { | |
611 | QFETCH(QVariant, min); |
|
611 | QFETCH(QVariant, min); | |
612 | m_axis->setMin(min); |
|
612 | m_axis->setMin(min); | |
613 | } |
|
613 | } | |
614 |
|
614 | |||
615 | void tst_QAbstractAxis::setRange_data() |
|
615 | void tst_QAbstractAxis::setRange_data() | |
616 | { |
|
616 | { | |
617 | //just check if it does not crash |
|
617 | //just check if it does not crash | |
618 | QTest::addColumn<QVariant>("min"); |
|
618 | QTest::addColumn<QVariant>("min"); | |
619 | QTest::addColumn<QVariant>("max"); |
|
619 | QTest::addColumn<QVariant>("max"); | |
620 | QTest::newRow("something") << QVariant("something0") << QVariant("something1"); |
|
620 | QTest::newRow("something") << QVariant("something0") << QVariant("something1"); | |
621 | QTest::newRow("-1 1") << QVariant(-1.0) << QVariant(1.0); |
|
621 | QTest::newRow("-1 1") << QVariant(-1.0) << QVariant(1.0); | |
622 | } |
|
622 | } | |
623 |
|
623 | |||
624 | // public void setRange(QVariant const& min, QVariant const& max) |
|
624 | // public void setRange(QVariant const& min, QVariant const& max) | |
625 | void tst_QAbstractAxis::setRange() |
|
625 | void tst_QAbstractAxis::setRange() | |
626 | { |
|
626 | { | |
627 |
|
627 | |||
628 | QFETCH(QVariant, min); |
|
628 | QFETCH(QVariant, min); | |
629 | QFETCH(QVariant, max); |
|
629 | QFETCH(QVariant, max); | |
630 | m_axis->setRange(min,max); |
|
630 | m_axis->setRange(min,max); | |
631 | } |
|
631 | } | |
632 |
|
632 | |||
633 | void tst_QAbstractAxis::shadesBorderColor_data() |
|
633 | void tst_QAbstractAxis::shadesBorderColor_data() | |
634 | { |
|
634 | { | |
635 |
|
635 | |||
636 | } |
|
636 | } | |
637 |
|
637 | |||
638 | void tst_QAbstractAxis::shadesBorderColor() |
|
638 | void tst_QAbstractAxis::shadesBorderColor() | |
639 | { |
|
639 | { | |
640 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
640 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
641 | QSKIP("Test is not implemented. This is deprecated function"); |
|
641 | QSKIP("Test is not implemented. This is deprecated function"); | |
642 | #else |
|
642 | #else | |
643 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); |
|
643 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); | |
644 | #endif |
|
644 | #endif | |
645 | } |
|
645 | } | |
646 |
|
646 | |||
647 | void tst_QAbstractAxis::shadesBrush_data() |
|
647 | void tst_QAbstractAxis::shadesBrush_data() | |
648 | { |
|
648 | { | |
649 | QTest::addColumn<QBrush>("shadesBrush"); |
|
649 | QTest::addColumn<QBrush>("shadesBrush"); | |
650 | QTest::newRow("null") << QBrush(); |
|
650 | QTest::newRow("null") << QBrush(); | |
651 | QTest::newRow("blue") << QBrush(Qt::blue); |
|
651 | QTest::newRow("blue") << QBrush(Qt::blue); | |
652 | QTest::newRow("black") << QBrush(Qt::black); |
|
652 | QTest::newRow("black") << QBrush(Qt::black); | |
653 | } |
|
653 | } | |
654 |
|
654 | |||
655 | void tst_QAbstractAxis::shadesBrush() |
|
655 | void tst_QAbstractAxis::shadesBrush() | |
656 | { |
|
656 | { | |
657 | QFETCH(QBrush, shadesBrush); |
|
657 | QFETCH(QBrush, shadesBrush); | |
658 |
|
658 | |||
659 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
659 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
660 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
660 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
661 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
661 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
662 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
662 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
663 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
663 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
664 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
664 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
665 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
665 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
666 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
666 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
667 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
667 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
668 |
|
668 | |||
669 | m_axis->setShadesBrush(shadesBrush); |
|
669 | m_axis->setShadesBrush(shadesBrush); | |
670 | QCOMPARE(m_axis->shadesBrush(), shadesBrush); |
|
670 | QCOMPARE(m_axis->shadesBrush(), shadesBrush); | |
671 |
|
671 | |||
672 | QCOMPARE(spy0.count(), 0); |
|
672 | QCOMPARE(spy0.count(), 0); | |
673 | QCOMPARE(spy1.count(), 0); |
|
673 | QCOMPARE(spy1.count(), 0); | |
674 | QCOMPARE(spy2.count(), 0); |
|
674 | QCOMPARE(spy2.count(), 0); | |
675 | QCOMPARE(spy3.count(), 0); |
|
675 | QCOMPARE(spy3.count(), 0); | |
676 | QCOMPARE(spy4.count(), 0); |
|
676 | QCOMPARE(spy4.count(), 0); | |
677 | QCOMPARE(spy5.count(), 0); |
|
677 | QCOMPARE(spy5.count(), 0); | |
678 | //TODO QCOMPARE(spy6.count(), 0); |
|
678 | //TODO QCOMPARE(spy6.count(), 0); | |
679 | QCOMPARE(spy7.count(), 0); |
|
679 | QCOMPARE(spy7.count(), 0); | |
680 | QCOMPARE(spy8.count(), 0); |
|
680 | QCOMPARE(spy8.count(), 0); | |
681 |
|
681 | |||
682 | m_view->show(); |
|
682 | m_view->show(); | |
683 | QTest::qWaitForWindowShown(m_view); |
|
683 | QTest::qWaitForWindowShown(m_view); | |
684 | QCOMPARE(m_axis->shadesBrush(), shadesBrush); |
|
684 | QCOMPARE(m_axis->shadesBrush(), shadesBrush); | |
685 | } |
|
685 | } | |
686 |
|
686 | |||
687 | void tst_QAbstractAxis::shadesColor_data() |
|
687 | void tst_QAbstractAxis::shadesColor_data() | |
688 | { |
|
688 | { | |
689 | } |
|
689 | } | |
690 |
|
690 | |||
691 | // public QColor shadesColor() const |
|
691 | // public QColor shadesColor() const | |
692 | void tst_QAbstractAxis::shadesColor() |
|
692 | void tst_QAbstractAxis::shadesColor() | |
693 | { |
|
693 | { | |
694 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) |
|
694 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |
695 | QSKIP("Test is not implemented. This is deprecated function"); |
|
695 | QSKIP("Test is not implemented. This is deprecated function"); | |
696 | #else |
|
696 | #else | |
697 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); |
|
697 | QSKIP("Test is not implemented. This is deprecated function", SkipAll); | |
698 | #endif |
|
698 | #endif | |
699 | } |
|
699 | } | |
700 |
|
700 | |||
701 | void tst_QAbstractAxis::shadesPen_data() |
|
701 | void tst_QAbstractAxis::shadesPen_data() | |
702 | { |
|
702 | { | |
703 | QTest::addColumn<QPen>("shadesPen"); |
|
703 | QTest::addColumn<QPen>("shadesPen"); | |
704 | QTest::newRow("null") << QPen(); |
|
704 | QTest::newRow("null") << QPen(); | |
705 | QTest::newRow("blue") << QPen(Qt::blue); |
|
705 | QTest::newRow("blue") << QPen(Qt::blue); | |
706 | QTest::newRow("black") << QPen(Qt::black); |
|
706 | QTest::newRow("black") << QPen(Qt::black); | |
707 | QTest::newRow("red") << QPen(Qt::red); |
|
707 | QTest::newRow("red") << QPen(Qt::red); | |
708 | } |
|
708 | } | |
709 |
|
709 | |||
710 | void tst_QAbstractAxis::shadesPen() |
|
710 | void tst_QAbstractAxis::shadesPen() | |
711 | { |
|
711 | { | |
712 | QFETCH(QPen, shadesPen); |
|
712 | QFETCH(QPen, shadesPen); | |
713 |
|
713 | |||
714 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
714 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
715 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
715 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
716 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
716 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
717 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
717 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
718 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
718 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
719 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
719 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
720 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
720 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
721 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
721 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
722 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
722 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
723 |
|
723 | |||
724 | m_axis->setShadesPen(shadesPen); |
|
724 | m_axis->setShadesPen(shadesPen); | |
725 | QCOMPARE(m_axis->shadesPen(), shadesPen); |
|
725 | QCOMPARE(m_axis->shadesPen(), shadesPen); | |
726 |
|
726 | |||
727 | QCOMPARE(spy0.count(), 0); |
|
727 | QCOMPARE(spy0.count(), 0); | |
728 | QCOMPARE(spy1.count(), 0); |
|
728 | QCOMPARE(spy1.count(), 0); | |
729 | QCOMPARE(spy2.count(), 0); |
|
729 | QCOMPARE(spy2.count(), 0); | |
730 | QCOMPARE(spy3.count(), 0); |
|
730 | QCOMPARE(spy3.count(), 0); | |
731 | QCOMPARE(spy4.count(), 0); |
|
731 | QCOMPARE(spy4.count(), 0); | |
732 | QCOMPARE(spy5.count(), 0); |
|
732 | QCOMPARE(spy5.count(), 0); | |
733 | QCOMPARE(spy6.count(), 0); |
|
733 | QCOMPARE(spy6.count(), 0); | |
734 | QCOMPARE(spy7.count(), 0); |
|
734 | QCOMPARE(spy7.count(), 0); | |
735 | QCOMPARE(spy8.count(), 0); |
|
735 | QCOMPARE(spy8.count(), 0); | |
736 |
|
736 | |||
737 | m_chart->setAxisX(m_axis, m_series); |
|
737 | m_chart->setAxisX(m_axis, m_series); | |
738 | m_view->show(); |
|
738 | m_view->show(); | |
739 | QTest::qWaitForWindowShown(m_view); |
|
739 | QTest::qWaitForWindowShown(m_view); | |
740 | QCOMPARE(m_axis->shadesPen(), shadesPen); |
|
740 | QCOMPARE(m_axis->shadesPen(), shadesPen); | |
741 | } |
|
741 | } | |
742 |
|
742 | |||
743 | void tst_QAbstractAxis::shadesVisible_data() |
|
743 | void tst_QAbstractAxis::shadesVisible_data() | |
744 | { |
|
744 | { | |
745 | QTest::addColumn<bool>("shadesVisible"); |
|
745 | QTest::addColumn<bool>("shadesVisible"); | |
746 | QTest::newRow("true") << true; |
|
746 | QTest::newRow("true") << true; | |
747 | QTest::newRow("false") << false; |
|
747 | QTest::newRow("false") << false; | |
748 | } |
|
748 | } | |
749 |
|
749 | |||
750 | void tst_QAbstractAxis::shadesVisible() |
|
750 | void tst_QAbstractAxis::shadesVisible() | |
751 | { |
|
751 | { | |
752 | QFETCH(bool, shadesVisible); |
|
752 | QFETCH(bool, shadesVisible); | |
753 |
|
753 | |||
754 | m_axis->setShadesVisible(!shadesVisible); |
|
754 | m_axis->setShadesVisible(!shadesVisible); | |
755 |
|
755 | |||
756 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
756 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
757 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
757 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
758 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
758 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
759 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
759 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
760 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
760 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
761 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
761 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
762 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
762 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
763 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
763 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
764 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
764 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
765 |
|
765 | |||
766 | m_axis->setShadesVisible(shadesVisible); |
|
766 | m_axis->setShadesVisible(shadesVisible); | |
767 | QCOMPARE(m_axis->shadesVisible(), shadesVisible); |
|
767 | QCOMPARE(m_axis->shadesVisible(), shadesVisible); | |
768 |
|
768 | |||
769 | QCOMPARE(spy0.count(), 0); |
|
769 | QCOMPARE(spy0.count(), 0); | |
770 | QCOMPARE(spy1.count(), 0); |
|
770 | QCOMPARE(spy1.count(), 0); | |
771 | QCOMPARE(spy2.count(), 0); |
|
771 | QCOMPARE(spy2.count(), 0); | |
772 | QCOMPARE(spy3.count(), 0); |
|
772 | QCOMPARE(spy3.count(), 0); | |
773 | QCOMPARE(spy4.count(), 0); |
|
773 | QCOMPARE(spy4.count(), 0); | |
774 | QCOMPARE(spy5.count(), 0); |
|
774 | QCOMPARE(spy5.count(), 0); | |
775 | QCOMPARE(spy6.count(), 0); |
|
775 | QCOMPARE(spy6.count(), 0); | |
776 | QCOMPARE(spy7.count(), 1); |
|
776 | QCOMPARE(spy7.count(), 1); | |
777 | QCOMPARE(spy8.count(), 0); |
|
777 | QCOMPARE(spy8.count(), 0); | |
778 |
|
778 | |||
779 | m_chart->setAxisX(m_axis, m_series); |
|
779 | m_chart->setAxisX(m_axis, m_series); | |
780 | m_view->show(); |
|
780 | m_view->show(); | |
781 | QTest::qWaitForWindowShown(m_view); |
|
781 | QTest::qWaitForWindowShown(m_view); | |
782 | QCOMPARE(m_axis->shadesVisible(), shadesVisible); |
|
782 | QCOMPARE(m_axis->shadesVisible(), shadesVisible); | |
783 | } |
|
783 | } | |
784 |
|
784 | |||
785 | void tst_QAbstractAxis::show_data() |
|
785 | void tst_QAbstractAxis::show_data() | |
786 | { |
|
786 | { | |
787 |
|
787 | |||
788 | } |
|
788 | } | |
789 |
|
789 | |||
790 | void tst_QAbstractAxis::show() |
|
790 | void tst_QAbstractAxis::show() | |
791 | { |
|
791 | { | |
792 | m_axis->hide(); |
|
792 | m_axis->hide(); | |
793 | QCOMPARE(m_axis->isVisible(), false); |
|
793 | QCOMPARE(m_axis->isVisible(), false); | |
794 |
|
794 | |||
795 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
795 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
796 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
796 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
797 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
797 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
798 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
798 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
799 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
799 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
800 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
800 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
801 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
801 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
802 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
802 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
803 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
803 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
804 |
|
804 | |||
805 | m_axis->show(); |
|
805 | m_axis->show(); | |
806 |
|
806 | |||
807 | QCOMPARE(spy0.count(), 0); |
|
807 | QCOMPARE(spy0.count(), 0); | |
808 | QCOMPARE(spy1.count(), 0); |
|
808 | QCOMPARE(spy1.count(), 0); | |
809 | QCOMPARE(spy2.count(), 0); |
|
809 | QCOMPARE(spy2.count(), 0); | |
810 | QCOMPARE(spy3.count(), 0); |
|
810 | QCOMPARE(spy3.count(), 0); | |
811 | QCOMPARE(spy4.count(), 0); |
|
811 | QCOMPARE(spy4.count(), 0); | |
812 | QCOMPARE(spy5.count(), 0); |
|
812 | QCOMPARE(spy5.count(), 0); | |
813 | QCOMPARE(spy6.count(), 0); |
|
813 | QCOMPARE(spy6.count(), 0); | |
814 | QCOMPARE(spy7.count(), 0); |
|
814 | QCOMPARE(spy7.count(), 0); | |
815 | QCOMPARE(spy8.count(), 1); |
|
815 | QCOMPARE(spy8.count(), 1); | |
816 | QCOMPARE(m_axis->isVisible(), true); |
|
816 | QCOMPARE(m_axis->isVisible(), true); | |
817 | } |
|
817 | } | |
818 |
|
818 | |||
819 | void tst_QAbstractAxis::hide_data() |
|
819 | void tst_QAbstractAxis::hide_data() | |
820 | { |
|
820 | { | |
821 |
|
821 | |||
822 | } |
|
822 | } | |
823 |
|
823 | |||
824 | void tst_QAbstractAxis::hide() |
|
824 | void tst_QAbstractAxis::hide() | |
825 | { |
|
825 | { | |
826 | m_axis->show(); |
|
826 | m_axis->show(); | |
827 | QCOMPARE(m_axis->isVisible(),true); |
|
827 | QCOMPARE(m_axis->isVisible(),true); | |
828 |
|
828 | |||
829 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); |
|
829 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | |
830 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); |
|
830 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | |
831 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); |
|
831 | QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | |
832 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); |
|
832 | QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | |
833 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); |
|
833 | QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | |
834 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); |
|
834 | QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | |
835 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); |
|
835 | QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | |
836 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); |
|
836 | QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | |
837 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); |
|
837 | QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | |
838 |
|
838 | |||
839 | m_axis->hide(); |
|
839 | m_axis->hide(); | |
840 |
|
840 | |||
841 | QCOMPARE(spy0.count(), 0); |
|
841 | QCOMPARE(spy0.count(), 0); | |
842 | QCOMPARE(spy1.count(), 0); |
|
842 | QCOMPARE(spy1.count(), 0); | |
843 | QCOMPARE(spy2.count(), 0); |
|
843 | QCOMPARE(spy2.count(), 0); | |
844 | QCOMPARE(spy3.count(), 0); |
|
844 | QCOMPARE(spy3.count(), 0); | |
845 | QCOMPARE(spy4.count(), 0); |
|
845 | QCOMPARE(spy4.count(), 0); | |
846 | QCOMPARE(spy5.count(), 0); |
|
846 | QCOMPARE(spy5.count(), 0); | |
847 | QCOMPARE(spy6.count(), 0); |
|
847 | QCOMPARE(spy6.count(), 0); | |
848 | QCOMPARE(spy7.count(), 0); |
|
848 | QCOMPARE(spy7.count(), 0); | |
849 | QCOMPARE(spy8.count(), 1); |
|
849 | QCOMPARE(spy8.count(), 1); | |
850 | QCOMPARE(m_axis->isVisible(),false); |
|
850 | QCOMPARE(m_axis->isVisible(),false); | |
851 | } |
|
851 | } | |
852 |
|
852 | |||
853 |
|
853 | |||
854 |
|
854 | |||
855 |
|
855 | |||
856 |
|
856 | |||
857 |
|
857 | |||
858 |
|
858 | |||
859 |
|
859 | |||
860 |
|
860 | |||
861 |
|
861 | |||
862 |
|
862 | |||
863 |
|
863 |
General Comments 0
You need to be logged in to leave comments.
Login now