+ Message msg(
+ // Read timestamp in seconds as 64-bit integer
+ //
+ // NOTE: This is a loss of precision. The database time column would need
+ // to store a fractional number to support fromMSecsSinceEpoch(), or an
+ // upgrade step would need to convert all past times to milliseconds,
+ // multiplying by 1000.
+#if QT_VERSION >= 0x050800
+ QDateTime::fromSecsSinceEpoch(query.value(1).toLongLong()),
+#else
+ // fromSecsSinceEpoch() was added in Qt 5.8. Manually downconvert to
+ // seconds for now.
+ // See https://doc.qt.io/qt-5/qdatetime.html#fromMSecsSinceEpoch
+ QDateTime::fromMSecsSinceEpoch(
+ (qint64)(query.value(1).toLongLong() * 1000)),
+#endif