Skip to content

Commit

Permalink
Documentation tweaks in QDate(Time)?::toString()
Browse files Browse the repository at this point in the history
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 <paul.wicking@qt.io>
  • Loading branch information
ediosyncratic committed Feb 2, 2024
1 parent 6fc93f9 commit 8c178a5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/corelib/time/qdatetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c178a5

Please sign in to comment.