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)