From 4b507e8257243e36f40089d57099c2d668c5884d Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 5 Jan 2017 16:28:53 -0800 Subject: Add conversion functions for QTimeZone and CFTimeZone/NSTimeZone Change-Id: I3a2e18d69577296bf612e13e40414bce1daa6a71 Reviewed-by: Thiago Macieira --- src/corelib/tools/qtimezone.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/corelib/tools/qtimezone.h') diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/tools/qtimezone.h index 083f87f39f..bd87139f5b 100644 --- a/src/corelib/tools/qtimezone.h +++ b/src/corelib/tools/qtimezone.h @@ -47,6 +47,11 @@ QT_REQUIRE_CONFIG(timezone); +#if (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE) +Q_FORWARD_DECLARE_CF_TYPE(CFTimeZone); +Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone); +#endif + QT_BEGIN_NAMESPACE class QTimeZonePrivate; @@ -142,6 +147,13 @@ public: static QList windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Country country); +#if (defined(Q_OS_DARWIN) || defined(Q_QDOC)) && !defined(QT_NO_SYSTEMLOCALE) + static QTimeZone fromCFTimeZone(CFTimeZoneRef timeZone); + CFTimeZoneRef toCFTimeZone() const Q_DECL_CF_RETURNS_RETAINED; + static QTimeZone fromNSTimeZone(const NSTimeZone *timeZone); + NSTimeZone *toNSTimeZone() const Q_DECL_NS_RETURNS_AUTORELEASED; +#endif + private: QTimeZone(QTimeZonePrivate &dd); #ifndef QT_NO_DATASTREAM -- cgit v1.2.3