User Chart Time Axis Bug

.. due to qt-bug 62285 we need to use local time not UTC for timespec
   since qt charts converts to local time internally.

.. this fixes axes starting at 1hr instead of 0h.
This commit is contained in:
Mark Liversedge
2020-05-01 13:53:22 +01:00
parent e1db9c832f
commit d6c16dd9de

View File

@@ -161,8 +161,8 @@ GenericChart::preprocessData()
// any series on an axis that is time based
// will need to have the values scaled from
// seconds to MSSinceEpoch
QDateTime midnight(QDate::currentDate(), QTime(0,0,0), Qt::UTC);
QDateTime earliest(QDate(1900,01,01), QTime(0,0,0));
QDateTime midnight(QDate::currentDate(), QTime(0,0,0), Qt::LocalTime); // we always use LocalTime due to qt-bug 62285
QDateTime earliest(QDate(1900,01,01), QTime(0,0,0), Qt::LocalTime);
for(int ai=0; ai<newAxes.count(); ai++) {
GenericAxisInfo &axis=newAxes[ai];