summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-08-17 18:34:09 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2017-08-22 09:47:22 +0000
commitb6a61211280aa6ddd56f107a9795c9824b7702b0 (patch)
tree98e7dc1660a9d88a9b12d51b764501369169a866 /src/corelib/tools/qdatetime.h
parent8b3a120a3b05803494d4e06edb5a8f4ee5d080f6 (diff)
Deprecate QDate methods using MonthNameType
These introduce an unwanted locale-dependency; clients should use suitable QLocale methods instead. Task-number: QTBUG-28581 Change-Id: Ie7dfe712c50b9f5da94e4b20af7b231d8963cbc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetime.h')
-rw-r--r--src/corelib/tools/qdatetime.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 815fa12b23..adab47fc1f 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -59,7 +59,7 @@ class QTimeZone;
class Q_CORE_EXPORT QDate
{
public:
- enum MonthNameType {
+ enum MonthNameType { // ### Qt 6: remove, along with methods using it
DateFormat = 0,
StandaloneFormat
};
@@ -81,12 +81,16 @@ public:
int daysInYear() const;
int weekNumber(int *yearNum = Q_NULLPTR) const;
-#ifndef QT_NO_TEXTDATE
- static QString shortMonthName(int month, MonthNameType type = DateFormat);
- static QString shortDayName(int weekday, MonthNameType type = DateFormat);
- static QString longMonthName(int month, MonthNameType type = DateFormat);
- static QString longDayName(int weekday, MonthNameType type = DateFormat);
-#endif // QT_NO_TEXTDATE
+#if QT_DEPRECATED_SINCE(5, 11) && !defined QT_NO_TEXTDATE
+ QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
+ static QString shortMonthName(int month, MonthNameType type = DateFormat);
+ QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
+ static QString shortDayName(int weekday, MonthNameType type = DateFormat);
+ QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
+ static QString longMonthName(int month, MonthNameType type = DateFormat);
+ QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
+ static QString longDayName(int weekday, MonthNameType type = DateFormat);
+#endif // QT_NO_TEXTDATE && deprecated
#ifndef QT_NO_DATESTRING
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2