From 245df962f0c3951ec4b1fe2b84df005024c6db21 2012-10-24 07:50:49 From: Marek Rosa Date: 2012-10-24 07:50:49 Subject: [PATCH] Fix the warning in chartviewer --- diff --git a/demos/chartviewer/charts/axis/datetimeaxisx.cpp b/demos/chartviewer/charts/axis/datetimeaxisx.cpp index 6d651a6..cca9efd 100644 --- a/demos/chartviewer/charts/axis/datetimeaxisx.cpp +++ b/demos/chartviewer/charts/axis/datetimeaxisx.cpp @@ -40,13 +40,15 @@ public: datetimeaxis->setTickCount(10); datetimeaxis->setFormat("yyyy"); + qreal day = 1000l * 60l * 60l * 24l; + QString name("Series "); int nameIndex = 0; foreach (DataList list, table) { QLineSeries *series = new QLineSeries(chart); foreach (Data data, list) { QPointF point = data.first; - series->append(1000l * 60l * 60l * 24l * 365l * 30l + point.x() * 1000l * 60l * 60l * 24l * 365l, point.y()); + series->append(day * 365l * 30l + point.x() * day * 365l, point.y()); } series->setName(name + QString::number(nameIndex)); nameIndex++; diff --git a/demos/chartviewer/charts/axis/datetimeaxisy.cpp b/demos/chartviewer/charts/axis/datetimeaxisy.cpp index be45d9e..b2b0cb7 100644 --- a/demos/chartviewer/charts/axis/datetimeaxisy.cpp +++ b/demos/chartviewer/charts/axis/datetimeaxisy.cpp @@ -40,13 +40,15 @@ public: datetimeaxis->setTickCount(10); datetimeaxis->setFormat("yyyy"); + qreal day = 1000l * 60l * 60l * 24l; + QString name("Series "); int nameIndex = 0; foreach (DataList list, table) { QLineSeries *series = new QLineSeries(chart); foreach (Data data, list) { QPointF point = data.first; - series->append(point.x(), 1000l * 60l * 60l * 24l * 365l * 30l + point.y() * 1000l * 60l * 60l * 24l * 365l); + series->append(point.x(), day * 365l * 30l + point.y() * day * 365l); } series->setName(name + QString::number(nameIndex)); nameIndex++;