diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qtimezone.h | 12 | ||||
-rw-r--r-- | src/corelib/tools/qtimezoneprivate_mac.mm | 5 | ||||
-rw-r--r-- | src/corelib/tools/qtimezoneprivate_p.h | 12 |
3 files changed, 22 insertions, 7 deletions
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<QByteArray> 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 diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/tools/qtimezoneprivate_mac.mm index 5dfffeaf36..0c2dbe6fef 100644 --- a/src/corelib/tools/qtimezoneprivate_mac.mm +++ b/src/corelib/tools/qtimezoneprivate_mac.mm @@ -273,4 +273,9 @@ QList<QByteArray> QMacTimeZonePrivate::availableTimeZoneIds() const return list; } +NSTimeZone *QMacTimeZonePrivate::nsTimeZone() const +{ + return m_nstz; +} + QT_END_NAMESPACE diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h index c397c18aac..682edd3996 100644 --- a/src/corelib/tools/qtimezoneprivate_p.h +++ b/src/corelib/tools/qtimezoneprivate_p.h @@ -60,13 +60,9 @@ #include <unicode/ucal.h> #endif -#ifdef Q_OS_MAC -#ifdef __OBJC__ -@class NSTimeZone; -#else -class NSTimeZone; -#endif // __OBJC__ -#endif // Q_OS_MAC +#ifdef Q_OS_DARWIN +Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone); +#endif // Q_OS_DARWIN #ifdef Q_OS_WIN #include <qt_windows.h> @@ -380,6 +376,8 @@ public: QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE; + NSTimeZone *nsTimeZone() const; + private: void init(const QByteArray &zoneId); |