summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-09-19 13:31:18 +0200
committerLiang Qi <liang.qi@qt.io>2018-09-24 17:12:29 +0000
commitb26cd68bf61346273a5a03bbc1e60a7cdffa4f0d (patch)
tree7580a1749931d86bfd67357d1be73355d6b7645e /src/corelib/tools/qdatetime.h
parente226b0f94afc85f79d82fc54421487bf2a529ba5 (diff)
Modernize the "datestring" feature
Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qdatetime.h')
-rw-r--r--src/corelib/tools/qdatetime.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 399fba4413..43271b34ed 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -91,7 +91,7 @@ public:
QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName")
static QString longDayName(int weekday, MonthNameType type = DateFormat);
#endif // textdate && deprecated
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
@@ -123,7 +123,7 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
Q_DECL_CONSTEXPR bool operator>=(const QDate &other) const { return jd >= other.jd; }
static QDate currentDate();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QDate fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDate fromString(const QString &s, const QString &format);
#endif
@@ -167,7 +167,7 @@ public:
int minute() const;
int second() const;
int msec() const;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
@@ -192,7 +192,7 @@ public:
Q_DECL_CONSTEXPR inline int msecsSinceStartOfDay() const { return mds == NullTime ? 0 : mds; }
static QTime currentTime();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QTime fromString(const QString &s, const QString &format);
#endif
@@ -303,7 +303,7 @@ public:
void setMSecsSinceEpoch(qint64 msecs);
void setSecsSinceEpoch(qint64 secs);
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
@@ -342,7 +342,7 @@ public:
static QDateTime currentDateTime();
static QDateTime currentDateTimeUtc();
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
static QDateTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDateTime fromString(const QString &s, const QString &format);
#endif
@@ -386,7 +386,7 @@ private:
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
#endif
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING)
+#if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
#endif
};
@@ -401,7 +401,7 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &);
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &);
#endif // QT_NO_DATASTREAM
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING)
+#if !defined(QT_NO_DEBUG_STREAM) && QT_CONFIG(datestring)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDate &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);