diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-20 01:01:00 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-02-20 09:51:12 +0100 |
commit | 035f934d7a798e97bf0213a5d42a3d511132f03d (patch) | |
tree | 89aa6efdc86864ce479cddca6b9c4ba523c2754a /src/corelib/tools/qdatetime.cpp | |
parent | f4cc23cffbe3005f0a522cac938695e87ecd6407 (diff) | |
parent | da4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
Added tests/auto/testlib/selftests/expected_crashes_5.txt to work
round the output of the crashes test (which exercises UB, see
QTBUG-73903) being truncated on one test platform.
Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 600bd1e0e5..80d6dada60 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -908,10 +908,16 @@ QString QDate::toString(Qt::DateFormat format) const a minus sign is prepended in addition. \endtable - All other input characters will be ignored. Any sequence of characters that - are enclosed in single quotes will be treated as text and not be used as an - expression. Two consecutive single quotes ("''") are replaced by a singlequote - in the output. Formats without separators (e.g. "ddMM") are currently not supported. + Any sequence of characters enclosed in single quotes will be included + verbatim in the output string (stripped of the quotes), even if it contains + formatting characters. Two consecutive single quotes ("''") are replaced by + a single quote in the output. All other characters in the format string are + included verbatim in the output string. + + Formats without separators (e.g. "ddMM") are supported but must be used with + care, as the resulting strings aren't always reliably readable (e.g. if "dM" + produces "212" it could mean either the 2nd of December or the 21st of + February). Example format strings (assuming that the QDate is the 20 July 1969): @@ -1672,10 +1678,16 @@ QString QTime::toString(Qt::DateFormat format) const \row \li t \li the timezone (for example "CEST") \endtable - All other input characters will be ignored. Any sequence of characters that - are enclosed in single quotes will be treated as text and not be used as an - expression. Two consecutive single quotes ("''") are replaced by a singlequote - in the output. Formats without separators (e.g. "HHmm") are currently not supported. + Any sequence of characters enclosed in single quotes will be included + verbatim in the output string (stripped of the quotes), even if it contains + formatting characters. Two consecutive single quotes ("''") are replaced by + a single quote in the output. All other characters in the format string are + included verbatim in the output string. + + Formats without separators (e.g. "ddMM") are supported but must be used with + care, as the resulting strings aren't always reliably readable (e.g. if "dM" + produces "212" it could mean either the 2nd of December or the 21st of + February). Example format strings (assuming that the QTime is 14:13:09.042 and the system locale is \c{en_US}) @@ -3952,10 +3964,16 @@ QString QDateTime::toString(Qt::DateFormat format) const \row \li t \li the timezone (for example "CEST") \endtable - All other input characters will be ignored. Any sequence of characters that - are enclosed in single quotes will be treated as text and not be used as an - expression. Two consecutive single quotes ("''") are replaced by a singlequote - in the output. Formats without separators (e.g. "HHmm") are currently not supported. + Any sequence of characters enclosed in single quotes will be included + verbatim in the output string (stripped of the quotes), even if it contains + formatting characters. Two consecutive single quotes ("''") are replaced by + a single quote in the output. All other characters in the format string are + included verbatim in the output string. + + Formats without separators (e.g. "ddMM") are supported but must be used with + care, as the resulting strings aren't always reliably readable (e.g. if "dM" + produces "212" it could mean either the 2nd of December or the 21st of + February). Example format strings (assumed that the QDateTime is 21 May 2001 14:13:09.120): |