summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-01-22 16:12:24 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-01-31 19:20:43 +0100
commitd6d98f782aeb798649c2bf5f7744065b7e86c035 (patch)
tree8f05dd4cd59bcc73d5023205109755a5cff5387c /src/corelib/global
parent05ce1821cd18e745f7d126ed93ab0c68125993b6 (diff)
Deprecate locale-related DateFormat enum members
Qt 6 shall remove all locale-dependence from Q(Date|Time)+. Task-number: QTBUG-80441 Change-Id: Iebaaa2bd776bccfe0d73c15f36cbdd456b71ca59 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qnamespace.h20
-rw-r--r--src/corelib/global/qnamespace.qdoc54
2 files changed, 44 insertions, 30 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 8f40393a7e..ea2c635303 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -1267,14 +1267,16 @@ public:
enum DateFormat {
TextDate, // default Qt
ISODate, // ISO 8601
- SystemLocaleDate, // deprecated
- LocalDate = SystemLocaleDate, // deprecated
- LocaleDate, // deprecated
- SystemLocaleShortDate,
- SystemLocaleLongDate,
- DefaultLocaleShortDate,
- DefaultLocaleLongDate,
- RFC2822Date, // RFC 2822 (+ 850 and 1036 during parsing)
+#if QT_DEPRECATED_SINCE(5, 15)
+ SystemLocaleDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
+ LocalDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale") = 2, // i.e. SystemLocaleDate
+ LocaleDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
+ SystemLocaleShortDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
+ SystemLocaleLongDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
+ DefaultLocaleShortDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
+ DefaultLocaleLongDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
+#endif
+ RFC2822Date = 8, // RFC 2822 (+ 850 and 1036 during parsing)
ISODateWithMs
};
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9acb978efc..8debee7bb5 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -709,26 +709,38 @@
\value ISODateWithMs \l{ISO 8601} extended format, including milliseconds if applicable.
- \value SystemLocaleShortDate The \l{QLocale::ShortFormat}{short format} used
- by the \l{QLocale::system()}{operating system}.
-
- \value SystemLocaleLongDate The \l{QLocale::LongFormat}{long format} used
- by the \l{QLocale::system()}{operating system}.
-
- \value DefaultLocaleShortDate The \l{QLocale::ShortFormat}{short format} specified
- by the \l{QLocale::setDefault()}{application's locale}.
-
- \value DefaultLocaleLongDate The \l{QLocale::LongFormat}{long format} used
- by the \l{QLocale::setDefault()}{application's locale}.
-
- \value SystemLocaleDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate
- instead (or Qt::SystemLocaleLongDate if you want long dates).
-
- \value LocaleDate \e{This enum value is deprecated.} Use Qt::DefaultLocaleShortDate
- instead (or Qt::DefaultLocaleLongDate if you want long dates).
-
- \value LocalDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate
- instead (or Qt::SystemLocaleLongDate if you want long dates).
+ \value SystemLocaleShortDate \e{This enum value is deprecated and
+ shall be removed in Qt 6.} Use QLocale's methods for converting
+ dates and times to and from strings, with the
+ \l{QLocale::ShortFormat}{short format} of
+ \l{QLocale::system()}{the locale used by the operating system}.
+
+ \value SystemLocaleLongDate \e{This enum value is deprecated and
+ shall be removed in Qt 6.} Use QLocale's methods for converting
+ dates and times to and from strings, with the
+ \l{QLocale::LongFormat}{long format} of \l{QLocale::system()}{the
+ locale used by the operating system}.
+
+ \value DefaultLocaleShortDate \e{This enum value is deprecated and
+ shall be removed in Qt 6.} Use QLocale's methods for converting
+ dates and times to and from strings, with the
+ \l{QLocale::ShortFormat}{short format} of
+ \l{QLocale::setDefault()}{the application's locale}.
+
+ \value DefaultLocaleLongDate \e{This enum value is deprecated and
+ shall be removed in Qt 6.} Use QLocale's methods for converting
+ dates and times to and from strings, with the
+ \l{QLocale::LongFormat}{long format} \l{QLocale::setDefault()}{the
+ application's locale}.
+
+ \value SystemLocaleDate \e{This enum value is deprecated and shall
+ be removed in Qt 6.} It is equivalent to SystemLocaleShortDate.
+
+ \value LocaleDate \e{This enum value is deprecated and shall be
+ removed in Qt 6.} It is equivalent to DefaultLocaleShortDate.
+
+ \value LocalDate \e{This enum value is deprecated and shall be
+ removed in Qt 6.} It is equivalent to SystemLocaleShortDate.
\value RFC2822Date \l{RFC 2822}, \l{RFC 850} and \l{RFC 1036} format:
either \c{[ddd,] dd MMM yyyy [hh:mm[:ss]][ ±tzoff]}