diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index b6090047f0..167db2bb6a 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -344,11 +344,12 @@ static int fromOffsetString(QStringView offsetString, bool *valid) noexcept \reentrant \brief The QDate class provides date functions. - A QDate object represents a particular day, regardless of calendar, - locale or other settings used when creating it or supplied by the system. - It can report the year, month and day of the month that represent the - day with respect to the proleptic Gregorian calendar or any calendar supplied - as a QCalendar object. + A QDate object represents a particular day, regardless of calendar, locale + or other settings used when creating it or supplied by the system. It can + report the year, month and day of the month that represent the day with + respect to the proleptic Gregorian calendar or any calendar supplied as a + QCalendar object. QDate objects should be passed by value rather than by + reference to const; they simply package \c qint64. A QDate object is typically created by giving the year, month, and day numbers explicitly. Note that QDate interprets year numbers less than 100 as @@ -1655,7 +1656,8 @@ bool QDate::isLeapYear(int y) A QTime object contains a clock time, which it can express as the numbers of hours, minutes, seconds, and milliseconds since midnight. It provides functions for comparing times and for manipulating a time by adding a number - of milliseconds. + of milliseconds. QTime objects should be passed by value rather than by + reference to const; they simply package \c int. QTime uses the 24-hour clock format; it has no concept of AM/PM. Unlike QDateTime, QTime knows nothing about time zones or diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index fedc17c947..b3e978ebf3 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -60,7 +60,7 @@ class QTimeZone; #endif class QDateTime; -class Q_CORE_EXPORT QDate // ### Qt 6: change to be used by value, not const & +class Q_CORE_EXPORT QDate { explicit constexpr QDate(qint64 julianDay) : jd(julianDay) {} public: @@ -156,7 +156,7 @@ private: }; Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE); -class Q_CORE_EXPORT QTime // ### Qt 6: change to be used by value, not const & +class Q_CORE_EXPORT QTime { explicit constexpr QTime(int ms) : mds(ms) {}