diff options
Diffstat (limited to 'src/corelib/time/qtimezone.h')
-rw-r--r-- | src/corelib/time/qtimezone.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/corelib/time/qtimezone.h b/src/corelib/time/qtimezone.h index 6040624f61..6c490c4e25 100644 --- a/src/corelib/time/qtimezone.h +++ b/src/corelib/time/qtimezone.h @@ -5,6 +5,7 @@ #ifndef QTIMEZONE_H #define QTIMEZONE_H +#include <QtCore/qcompare.h> #include <QtCore/qdatetime.h> #include <QtCore/qlocale.h> #include <QtCore/qswap.h> @@ -12,7 +13,7 @@ #include <chrono> -#if QT_CONFIG(timezone) && (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE) +#if QT_CONFIG(timezone) && (defined(Q_OS_DARWIN) || defined(Q_QDOC)) Q_FORWARD_DECLARE_CF_TYPE(CFTimeZone); Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone); #endif @@ -48,7 +49,7 @@ class Q_CORE_EXPORT QTimeZone #endif { } - friend constexpr bool operator==(const ShortData &lhs, const ShortData &rhs) + friend constexpr bool operator==(ShortData lhs, ShortData rhs) { return lhs.mode == rhs.mode && lhs.offset == rhs.offset; } constexpr Qt::TimeSpec spec() const { return Qt::TimeSpec((mode + 3) & 3); } }; @@ -114,8 +115,10 @@ public: void swap(QTimeZone &other) noexcept { d.swap(other.d); } +#if QT_CORE_REMOVED_SINCE(6, 7) bool operator==(const QTimeZone &other) const; bool operator!=(const QTimeZone &other) const; +#endif bool isValid() const; @@ -128,7 +131,7 @@ public: } static QTimeZone fromSecondsAheadOfUtc(int offset) { - return fromDurationAheadOfUtc(std::chrono::seconds{offset});; + return fromDurationAheadOfUtc(std::chrono::seconds{offset}); } constexpr Qt::TimeSpec timeSpec() const noexcept { return d.s.spec(); } constexpr int fixedSecondsAheadOfUtc() const noexcept @@ -163,6 +166,7 @@ public: }; typedef QList<OffsetData> OffsetDataList; + bool aliasMatches(QByteArrayView alias) const; QByteArray id() const; QLocale::Territory territory() const; # if QT_DEPRECATED_SINCE(6, 6) @@ -211,7 +215,7 @@ public: static QList<QByteArray> windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Territory territory); -# if (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE) +# if defined(Q_OS_DARWIN) || defined(Q_QDOC) static QTimeZone fromCFTimeZone(CFTimeZoneRef timeZone); CFTimeZoneRef toCFTimeZone() const Q_DECL_CF_RETURNS_RETAINED; static QTimeZone fromNSTimeZone(const NSTimeZone *timeZone); @@ -230,6 +234,9 @@ public: # endif #endif // feature timezone private: + friend Q_CORE_EXPORT bool comparesEqual(const QTimeZone &lhs, const QTimeZone &rhs) noexcept; + Q_DECLARE_EQUALITY_COMPARABLE(QTimeZone) + #ifndef QT_NO_DATASTREAM friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &ds, const QTimeZone &tz); #endif |