From 669f7e3b9723446732d31d48b653cd2bd9580f2d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 May 2024 11:28:20 +0200 Subject: [PATCH] Disambiguate a QDateTime construction When compiling removed_api.cpp, both the removed QDateTime(QDate, QTime) constructor and the one taking a transition resolution with a default are visible. The inline fromStdLocalTime() was thus ambiguous as to which it was calling. So make the transition resolution overt. Fixes: QTBUG-125079 Pick-to: 6.7 Change-Id: I0c498bed2831afee0adc41c4575f3ed1bc244122 Reviewed-by: Tim Blechmann Reviewed-by: Thiago Macieira --- src/corelib/time/qdatetime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index e1c0d29e2a..a9fefc4c22 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -529,7 +529,7 @@ public: QT_POST_CXX17_API_IN_EXPORTED_CLASS static QDateTime fromStdLocalTime(const std::chrono::local_time &time) { - QDateTime result(QDate(1970, 1, 1), QTime(0, 0, 0)); + QDateTime result(QDate(1970, 1, 1), QTime(0, 0, 0), TransitionResolution::LegacyBehavior); return result.addMSecs(time.time_since_epoch().count()); }