From 607165ede33c696aa45c82a3b2024ea0d3380bd9 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 30 Jan 2024 11:38:45 +0100 Subject: [PATCH] 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.2 Change-Id: I4edaa0ffaf59323e0af6412727f2a85866813ab8 Reviewed-by: Paul Wicking (cherry picked from commit 8c178a540faf27fdab6977b13507d94735f89e21) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 5bff9b1ec04aa3c4a80bd8d2f99429a108905867) (cherry picked from commit 0dbfefc9eed7ad7bb8341415dc69cfe19ac53ba6) --- src/corelib/time/qdatetime.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 6088a681073..6846deec49a 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -1140,12 +1140,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 @@ -1196,7 +1198,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 { @@ -4109,12 +4110,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