From d89dde522a67f6fb01f9879f45871efed5e35793 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 17 Feb 2020 14:50:09 +0100 Subject: Fix deprecation warning against QDateTime(QDate) Change-Id: Iaba4d9f1ea4b265326a8d1b07573b0f30b4d7428 Reviewed-by: Friedemann Kleint Reviewed-by: Qt CI Bot --- src/qml/qml/qqmllocale.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml') diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 139074c648..7af6af276a 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -314,7 +314,7 @@ ReturnedValue QQmlDateExtension::method_fromLocaleDateString(const QV4::Function QLocale locale; QString dateString = s->toQString(); QDate date = locale.toDate(dateString); - RETURN_RESULT(engine->newDateObject(QDateTime(date))); + RETURN_RESULT(engine->newDateObject(date.startOfDay())); } } @@ -341,7 +341,7 @@ ReturnedValue QQmlDateExtension::method_fromLocaleDateString(const QV4::Function dt = r->d()->locale->toDate(dateString, enumFormat); } - RETURN_RESULT(engine->newDateObject(QDateTime(dt))); + RETURN_RESULT(engine->newDateObject(dt.startOfDay())); } ReturnedValue QQmlDateExtension::method_timeZoneUpdated(const QV4::FunctionObject *b, const QV4::Value *, const QV4::Value *, int argc) -- cgit v1.2.3