aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllocale.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-02-17 14:50:09 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-02-18 11:37:40 +0100
commitd89dde522a67f6fb01f9879f45871efed5e35793 (patch)
tree27b95010f07af72cc26f3745f3a3b72ed032965b /src/qml/qml/qqmllocale.cpp
parent01284467e610552e041c6960da4fd4bb7c1cbc7e (diff)
Fix deprecation warning against QDateTime(QDate)
Change-Id: Iaba4d9f1ea4b265326a8d1b07573b0f30b4d7428 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmllocale.cpp')
-rw-r--r--src/qml/qml/qqmllocale.cpp4
1 files changed, 2 insertions, 2 deletions
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)