From 396fa0fcd9e286d7d2dbee6fb9d158eb198773a1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 25 Nov 2022 15:04:24 +0100 Subject: [PATCH] QDateTime::fromM?SecsSinceEpoch() docs: add missing note The spec+offset overloads include a note about times outside the supported range; however, this was missing for the time-zone overloads. Also label all four as \overload. Change-Id: I371ea8ff7d2fb26f679a078a1d8b5d70a6131c35 Reviewed-by: Thiago Macieira --- src/corelib/time/qdatetime.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 7e9a16acf5..caf37dc439 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -4801,6 +4801,8 @@ qint64 QDateTime::currentSecsSinceEpoch() noexcept #endif /*! + \overload + Returns a datetime representing a moment the given number \a msecs of milliseconds after the start, in UTC, of the year 1970, described as specified by \a spec and \a offsetSeconds. @@ -4828,6 +4830,7 @@ QDateTime QDateTime::fromMSecsSinceEpoch(qint64 msecs, Qt::TimeSpec spec, int of /*! \since 5.8 + \overload Returns a datetime representing a moment the given number \a secs of seconds after the start, in UTC, of the year 1970, described as specified by \a spec @@ -4857,11 +4860,16 @@ QDateTime QDateTime::fromSecsSinceEpoch(qint64 secs, Qt::TimeSpec spec, int offs #if QT_CONFIG(timezone) /*! \since 5.2 + \overload Returns a datetime representing a moment the given number \a msecs of milliseconds after the start, in UTC, of the year 1970, described as specified by \a timeZone. + Note that there are possible values for \a msecs that lie outside the valid + range of QDateTime, both negative and positive. The behavior of this + function is undefined for those values. + \sa fromSecsSinceEpoch(), toMSecsSinceEpoch(), setMSecsSinceEpoch() */ QDateTime QDateTime::fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone) @@ -4875,11 +4883,16 @@ QDateTime QDateTime::fromMSecsSinceEpoch(qint64 msecs, const QTimeZone &timeZone /*! \since 5.8 + \overload Returns a datetime representing a moment the given number \a secs of seconds after the start, in UTC, of the year 1970, described as specified by \a timeZone. + Note that there are possible values for \a secs that lie outside the valid + range of QDateTime, both negative and positive. The behavior of this + function is undefined for those values. + \sa fromMSecsSinceEpoch(), toSecsSinceEpoch(), setSecsSinceEpoch() */ QDateTime QDateTime::fromSecsSinceEpoch(qint64 secs, const QTimeZone &timeZone)