From 8c178a540faf27fdab6977b13507d94735f89e21 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 30 Jan 2024 11:38:45 +0100 Subject: Documentation tweaks in QDate(Time)?::toString() Include the \since markers they need, plus changes in past versions. Purge a stray blank line. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I4edaa0ffaf59323e0af6412727f2a85866813ab8 Reviewed-by: Paul Wicking --- src/corelib/time/qdatetime.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/corelib/time') diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 7d11605671..fc498d9298 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -1235,12 +1235,14 @@ QString QDate::toString(Qt::DateFormat format) const /*! \fn QString QDate::toString(const QString &format, QCalendar cal) const \fn QString QDate::toString(QStringView format, QCalendar cal) const + \since 5.14 Returns the date as a string. The \a format parameter determines the format of the result string. If \a cal is supplied, it determines the calendar used - to represent the date; it defaults to Gregorian. + to represent the date; it defaults to Gregorian. Prior to Qt 5.14, there was + no \a cal parameter and the Gregorian calendar was always used. - These expressions may be used: + These expressions may be used in the \a format parameter: \table \header \li Expression \li Output @@ -1291,7 +1293,6 @@ QString QDate::toString(Qt::DateFormat format) const in May will contribute \c{"MayMay05"} to the output. \sa fromString(), QDateTime::toString(), QTime::toString(), QLocale::toString() - */ QString QDate::toString(QStringView format, QCalendar cal) const { @@ -4666,12 +4667,14 @@ QString QDateTime::toString(Qt::DateFormat format) const /*! \fn QString QDateTime::toString(const QString &format, QCalendar cal) const \fn QString QDateTime::toString(QStringView format, QCalendar cal) const + \since 5.14 Returns the datetime as a string. The \a format parameter determines the - format of the result string. If \a cal is supplied, it determines the calendar - used to represent the date; it defaults to Gregorian. See QTime::toString() - and QDate::toString() for the supported specifiers for time and date, - respectively. + format of the result string. If \a cal is supplied, it determines the + calendar used to represent the date; it defaults to Gregorian. Prior to Qt + 5.14, there was no \a cal parameter and the Gregorian calendar was always + used. See QTime::toString() and QDate::toString() for the supported + specifiers for time and date, respectively, in the \a format parameter. Any sequence of characters enclosed in single quotes will be included verbatim in the output string (stripped of the quotes), even if it contains -- cgit v1.2.3