summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-02-28 14:42:41 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-07 12:34:22 +0000
commitaf92d6422b1c4d7ddbc8d452d415d6307b9f3163 (patch)
tree62f657c537d1593d9133468d73010efba7a00a68
parent91e5b279e9b67eb3c70c2fdabf11e6ffa20bfbe8 (diff)
Correct some typos and flat-out falsehoods in QTimeZone docs
Apparently the class docs didn't get an update when systemTimeZone() was added (at 5.5). Also add QCalendar to the \sa. Prompted by Jaishree pointing out a typo ... Change-Id: If6d38040fff4badc3c0bb765889c1289c560c2b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9c588704237e924a8e2e45c37abd74ca82c1068a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/corelib/time/qtimezone.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp
index 57ddef4e2d..2d892fb924 100644
--- a/src/corelib/time/qtimezone.cpp
+++ b/src/corelib/time/qtimezone.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Copyright (C) 2013 John Layt <jlayt@kde.org>
** Contact: https://www.qt.io/licensing/
**
@@ -108,7 +108,7 @@ class QTimeZoneSingleton
public:
QTimeZoneSingleton() : backend(newBackendTimeZone()) {}
- // The backend_tz is the tz to use in static methods such as availableTimeZoneIds() and
+ // The global_tz is the tz to use in static methods such as availableTimeZoneIds() and
// isTimeZoneIdAvailable() and to create named IANA time zones. This is usually the host
// system, but may be different if the host resources are insufficient or if
// QT_NO_SYSTEMLOCALE is set. A simple UTC backend is used if no alternative is available.
@@ -172,7 +172,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
support as much historic conversion data and so may only be accurate for
the current year.
- QTimeZone uses a conversion table derived form the Unicode CLDR data to map
+ QTimeZone uses a conversion table derived from the Unicode CLDR data to map
between IANA IDs and Windows IDs. Depending on your version of Windows
and Qt, this table may not be able to provide a valid conversion, in which
"UTC" will be returned.
@@ -184,10 +184,6 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
\section2 System Time Zone
- QTimeZone does not support any concept of a system or default time zone.
- If you require a QDateTime that uses the current system time zone at any
- given moment then you should use a Qt::TimeSpec of Qt::LocalTime.
-
The method systemTimeZoneId() returns the current system IANA time zone
ID which on Unix-like systems will always be correct. On Windows this ID is
translated from the Windows system ID using an internal translation
@@ -197,7 +193,13 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
Creating a new QTimeZone instance using the system time zone ID will only
produce a fixed named copy of the time zone, it will not change if the
- system time zone changes.
+ system time zone changes. QTimeZone::systemTimeZone() will return an
+ instance representing the zone named by this system ID. Note that
+ constructing a QDateTime using this system zone may behave differently than
+ constructing a QDateTime that uses Qt::LocalTime as its Qt::TimeSpec, as the
+ latter directly uses system APIs for accessing local time information, which
+ may behave differently (and, in particular, might adapt if the user adjusts
+ the system zone setting).
\section2 Time Zone Offsets
@@ -223,7 +225,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
of the Unicode Data Files and Software License. See
\l{unicode-cldr}{Unicode Common Locale Data Repository (CLDR)} for details.
- \sa QDateTime
+ \sa QDateTime, QCalendar
*/
/*!