! A convenience method which turns \a key (in seconds since Epoch 1. Jan 1970, 00:00 UTC) into a QDateTime object. This can be used to turn axis coordinates to actual QDateTimes. The accuracy achieved by this method is one millisecond, irrespective of the used Qt version (it works around the lack of a QDateTime::fromMSecsSinceEpoch in Qt 4.6) \see dateTimeToKey */
| 6100 | \see dateTimeToKey |
| 6101 | */ |
| 6102 | QDateTime QCPAxisTickerDateTime::keyToDateTime(double key) |
| 6103 | { |
| 6104 | # if QT_VERSION < QT_VERSION_CHECK(4, 7, 0) |
| 6105 | return QDateTime::fromTime_t(key).addMSecs((key-(qint64)key)*1000); |
| 6106 | # else |
| 6107 | return QDateTime::fromMSecsSinceEpoch(key*1000.0); |
| 6108 | # endif |
| 6109 | } |
| 6110 | |
| 6111 | /*! \overload |
| 6112 |
nothing calls this directly
no outgoing calls
no test coverage detected