From a04411119ead3d4473e4f0ac4bceedc585977b2f Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 21 Mar 2019 15:06:18 +0100 Subject: Save DST status when computed for a mutable QDateTimeData Most calls to localMSecsToEpochMSecs() happen from functions that can't save the DST status it repots (due to the data being const); but refreshDateTime() can and (given its name) clearly should. Pick-to: 5.15 Change-Id: Ib53c88d2233925da275f0ac52f768cada92c5d2d Reviewed-by: Thiago Macieira --- src/corelib/time/qdatetime.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index e38f8e70b9..d85b76147b 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -2826,6 +2826,7 @@ static void refreshDateTime(QDateTimeData &d) if (spec == Qt::LocalTime) { auto dstStatus = extractDaylightStatus(status); epochMSecs = localMSecsToEpochMSecs(msecs, &dstStatus, &testDate, &testTime); + status = mergeDaylightStatus(status, dstStatus); } if (timeToMSecs(testDate, testTime) == msecs) { status |= QDateTimePrivate::ValidDateTime; -- cgit v1.2.3