##// END OF EJS Templates
Docs and dateTime test updated
Marek Rosa -
r1733:51dc153251d2
parent child
Show More
@@ -62,6 +62,8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
62 \value AxisTypeNoAxis
62 \value AxisTypeNoAxis
63 \value AxisTypeValues
63 \value AxisTypeValues
64 \value AxisTypeCategories
64 \value AxisTypeCategories
65 \value AxisTypeIntervals
66 \value AxisTypeDateTime
65 */
67 */
66
68
67 /*!
69 /*!
@@ -232,6 +232,18 QTCOMMERCIALCHART_BEGIN_NAMESPACE
232 */
232 */
233
233
234 /*!
234 /*!
235 \property QPieSeries::donut
236
237 Defines whether the series should be drawn as a donut
238 */
239
240 /*!
241 \qmlproperty int PieSeries::donut
242
243 Defines whether the series should be drawn as a donut
244 */
245
246 /*!
235 \fn void QPieSeries::countChanged()
247 \fn void QPieSeries::countChanged()
236 Emitted when the slice count has changed.
248 Emitted when the slice count has changed.
237 \sa count
249 \sa count
@@ -48,10 +48,10 private slots:
48 void min();
48 void min();
49 // void min_animation_data();
49 // void min_animation_data();
50 // void min_animation();
50 // void min_animation();
51 // void range_raw_data();
51 void range_raw_data();
52 // void range_raw();
52 void range_raw();
53 // void range_data();
53 void range_data();
54 // void range();
54 void range();
55 // void range_animation_data();
55 // void range_animation_data();
56 // void range_animation();
56 // void range_animation();
57
57
@@ -77,7 +77,7 void tst_QDateTimeAxis::init()
77 m_dateTimeAxisY = new QDateTimeAxis();
77 m_dateTimeAxisY = new QDateTimeAxis();
78 m_series = new QLineSeries();
78 m_series = new QLineSeries();
79 *m_series << QPointF(-100, -100) << QPointF(0, 0) << QPointF(100, 100);
79 *m_series << QPointF(-100, -100) << QPointF(0, 0) << QPointF(100, 100);
80 // tst_QAbstractAxis::init(m_datetimeaxis, m_series);
80 // tst_QAbstractAxis::init(m_datetimeaxis, m_series);
81
81
82 m_view = new QChartView(new QChart());
82 m_view = new QChartView(new QChart());
83 m_chart = m_view->chart();
83 m_chart = m_view->chart();
@@ -97,7 +97,7 void tst_QDateTimeAxis::cleanup()
97 delete m_view;
97 delete m_view;
98 m_view = 0;
98 m_view = 0;
99 m_chart = 0;
99 m_chart = 0;
100 // tst_QAbstractAxis::cleanup();
100 // tst_QAbstractAxis::cleanup();
101 }
101 }
102
102
103 void tst_QDateTimeAxis::qdatetimeaxis_data()
103 void tst_QDateTimeAxis::qdatetimeaxis_data()
@@ -106,10 +106,10 void tst_QDateTimeAxis::qdatetimeaxis_data()
106
106
107 void tst_QDateTimeAxis::qdatetimeaxis()
107 void tst_QDateTimeAxis::qdatetimeaxis()
108 {
108 {
109 // qabstractaxis();
109 // qabstractaxis();
110
110
111 // QVERIFY(m_datetimeaxis->max().toMSecsSinceEpoch() == 0);
111 // QVERIFY(m_datetimeaxis->max().toMSecsSinceEpoch() == 0);
112 // QVERIFY(m_datetimeaxis->min().toMSecsSinceEpoch() == 0);
112 // QVERIFY(m_datetimeaxis->min().toMSecsSinceEpoch() == 0);
113 QCOMPARE(m_dateTimeAxisX->type(), QAbstractAxis::AxisTypeDateTime);
113 QCOMPARE(m_dateTimeAxisX->type(), QAbstractAxis::AxisTypeDateTime);
114
114
115 m_view->show();
115 m_view->show();
@@ -148,7 +148,7 void tst_QDateTimeAxis::max_raw()
148 QCOMPARE(spy1.count(), 0);
148 QCOMPARE(spy1.count(), 0);
149 QCOMPARE(spy2.count(), 1);
149 QCOMPARE(spy2.count(), 1);
150 } else {
150 } else {
151 QVERIFY2(m_dateTimeAxisX->max() != max, "Date is invalid");
151 QVERIFY2(m_dateTimeAxisX->max() != max, "Date is invalid and should not be set");
152 QCOMPARE(spy0.count(), 0);
152 QCOMPARE(spy0.count(), 0);
153 QCOMPARE(spy1.count(), 0);
153 QCOMPARE(spy1.count(), 0);
154 QCOMPARE(spy2.count(), 0);
154 QCOMPARE(spy2.count(), 0);
@@ -207,7 +207,7 void tst_QDateTimeAxis::min_raw()
207 QCOMPARE(spy1.count(), 1);
207 QCOMPARE(spy1.count(), 1);
208 QCOMPARE(spy2.count(), 1);
208 QCOMPARE(spy2.count(), 1);
209 } else {
209 } else {
210 QVERIFY2(m_dateTimeAxisX->min() != min, "Date is invalid");
210 QVERIFY2(m_dateTimeAxisX->min() != min, "Date is invalid and should not be set");
211 QCOMPARE(spy0.count(), 0);
211 QCOMPARE(spy0.count(), 0);
212 QCOMPARE(spy1.count(), 0);
212 QCOMPARE(spy1.count(), 0);
213 QCOMPARE(spy2.count(), 0);
213 QCOMPARE(spy2.count(), 0);
@@ -238,45 +238,68 void tst_QDateTimeAxis::min()
238 // min();
238 // min();
239 //}
239 //}
240
240
241 //void tst_QDateTimeAxis::range_raw_data()
241 void tst_QDateTimeAxis::range_raw_data()
242 //{
242 {
243 // QTest::addColumn<qreal>("min");
243 QTest::addColumn<QDateTime>("min");
244 // QTest::addColumn<qreal>("max");
244 QTest::addColumn<bool>("minValid");
245 // QTest::newRow("1.0 - 101.0") << -1.0 << 101.0;
245 QTest::addColumn<QDateTime>("max");
246 // QTest::newRow("25.0 - 75.0") << 25.0 << 75.0;
246 QTest::addColumn<bool>("maxValid");
247 // QTest::newRow("101.0") << 40.0 << 60.0;
248 //}
249
247
250 //void tst_QDateTimeAxis::range_raw()
248 QDateTime minDateTime;
251 //{
249 QDateTime maxDateTime;
252 // QFETCH(qreal, min);
250 minDateTime.setDate(QDate(1908, 1, 11));
253 // QFETCH(qreal, max);
251 maxDateTime.setDate(QDate(1958, 11, 21));
252 QTest::newRow("11.1.1908 - min valid, 21.12.1958 - max valid") << minDateTime << true << maxDateTime << true; // negative MSecs from Epoch, min < max
254
253
255 // QSignalSpy spy0(m_intervalsaxis, SIGNAL(maxChanged(qreal)));
254 minDateTime.setDate(QDate(2012, 17, 32));
256 // QSignalSpy spy1(m_intervalsaxis, SIGNAL(minChanged(qreal)));
255 QTest::newRow("32.17.2012 - min invalid, 21.12.1958 - max valid") << minDateTime << false << maxDateTime << true;
257 // QSignalSpy spy2(m_intervalsaxis, SIGNAL(rangeChanged(qreal, qreal)));
258
256
259 // m_intervalsaxis->setRange(min, max);
257 maxDateTime.setDate(QDate(2017, 0, 1));
260 // QVERIFY2(qFuzzyIsNull(m_intervalsaxis->min() - min), "Min not equal");
258 QTest::newRow("32.17.2012 - min invalid, 1.0.2017 - max invalid") << minDateTime << false << maxDateTime << false;
261 // QVERIFY2(qFuzzyIsNull(m_intervalsaxis->max() - max), "Max not equal");
262
259
263 // QCOMPARE(spy0.count(), 1);
260 minDateTime.setDate(QDate(2012, 1, 1));
264 // QCOMPARE(spy1.count(), 1);
261 QTest::newRow("1.1.2012 - min valid, 1.0.2017 - max invalid") << minDateTime << true << maxDateTime << false;
265 // QCOMPARE(spy2.count(), 1);
266 //}
267
262
268 //void tst_QDateTimeAxis::range_data()
263 maxDateTime.setDate(QDate(2005, 2, 5));
269 //{
264 QTest::newRow("1.1.2012 - min valid, 5.2.2005 - max valid") << minDateTime << true << maxDateTime << true; // min > max
270 // range_raw_data();
265 }
271 //}
272
266
273 //void tst_QDateTimeAxis::range()
267 void tst_QDateTimeAxis::range_raw()
274 //{
268 {
275 // m_chart->setAxisX(m_intervalsaxis, m_series);
269 QFETCH(QDateTime, min);
276 // m_view->show();
270 QFETCH(bool, minValid);
277 // QTest::qWaitForWindowShown(m_view);
271 QFETCH(QDateTime, max);
278 // range_raw();
272 QFETCH(bool, maxValid);
279 //}
273
274 QSignalSpy spy0(m_dateTimeAxisX, SIGNAL(maxChanged(QDateTime)));
275 QSignalSpy spy1(m_dateTimeAxisX, SIGNAL(minChanged(QDateTime)));
276 QSignalSpy spy2(m_dateTimeAxisX, SIGNAL(rangeChanged(QDateTime, QDateTime)));
277
278 m_dateTimeAxisX->setRange(min, max);
279
280 if (minValid && maxValid && min < max) {
281 QCOMPARE(spy0.count(), 1);
282 QCOMPARE(spy1.count(), 1);
283 QCOMPARE(spy2.count(), 1);
284 } else {
285 QCOMPARE(spy0.count(), 0);
286 QCOMPARE(spy1.count(), 0);
287 QCOMPARE(spy2.count(), 0);
288 }
289 }
290
291 void tst_QDateTimeAxis::range_data()
292 {
293 range_raw_data();
294 }
295
296 void tst_QDateTimeAxis::range()
297 {
298 m_chart->setAxisX(m_dateTimeAxisX, m_series);
299 m_view->show();
300 QTest::qWaitForWindowShown(m_view);
301 range_raw();
302 }
280
303
281 //void tst_QDateTimeAxis::range_animation_data()
304 //void tst_QDateTimeAxis::range_animation_data()
282 //{
305 //{
General Comments 0
You need to be logged in to leave comments. Login now