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 <tim@klingt.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2024-05-06 11:28:20 +02:00
parent 251a632dc4
commit 669f7e3b97

View File

@ -529,7 +529,7 @@ public:
QT_POST_CXX17_API_IN_EXPORTED_CLASS
static QDateTime fromStdLocalTime(const std::chrono::local_time<std::chrono::milliseconds> &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());
}