From 633eeaafdd7c53547c405ea6483511a8154328c5 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 26 Jun 2020 05:55:29 +0200 Subject: [PATCH] Port away from deprecated QDateTime(QDate) constructor GIT_SILENT --- src/declarativeimports/calendar/calendar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/declarativeimports/calendar/calendar.cpp b/src/declarativeimports/calendar/calendar.cpp index c77824d5a..b29d14092 100644 --- a/src/declarativeimports/calendar/calendar.cpp +++ b/src/declarativeimports/calendar/calendar.cpp @@ -41,7 +41,11 @@ Calendar::Calendar(QObject *parent) QDateTime Calendar::displayedDate() const { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + return m_displayedDate.startOfDay(); +#else return QDateTime(m_displayedDate); +#endif } void Calendar::setDisplayedDate(const QDate &dateTime) @@ -74,7 +78,11 @@ void Calendar::setDisplayedDate(const QDateTime &dateTime) QDateTime Calendar::today() const { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + return m_today.startOfDay(); +#else return QDateTime(m_today); +#endif } void Calendar::setToday(const QDateTime &dateTime)