diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-05-19 23:01:59 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2016-08-19 21:05:55 +0000 |
commit | 57378a108ca488cbf5cfaa32590fc762dcbf3315 (patch) | |
tree | 3a8a3851959f6fc06d0a1c65ac9fa16508e12ee4 /src/corelib/kernel | |
parent | 2f108fafe98047f9ed2c85c5938579fdeb90682d (diff) |
Add support for Apple watchOS
Change-Id: I3f9e00569458a463af2eaa5a3a16a6afd1e9c1ea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/kernel.pri | 5 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_mac_objc.mm | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_unix_p.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_cf.mm | 4 |
5 files changed, 13 insertions, 4 deletions
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index 2388bbe9be..a78397e46c 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -123,6 +123,11 @@ mac { # We need UIKit for UIDevice LIBS_PRIVATE += -framework UIKit } + + watchos { + # We need WatchKit for WKExtension in qeventdispatcher_cf.mm + LIBS_PRIVATE += -framework WatchKit + } } nacl { diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 068b6b0440..ee1a290386 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -101,7 +101,7 @@ QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(QT_DECLARE_WEAK_QDEBUG_OPERATOR_FOR_CF_TY QAppleOperatingSystemVersion qt_apple_os_version() { QAppleOperatingSystemVersion v = {0, 0, 0}; -#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_8_0) || defined(Q_OS_TVOS) +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_8_0) || defined(Q_OS_TVOS) || defined(Q_OS_WATCHOS) if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) { NSOperatingSystemVersion osv = NSProcessInfo.processInfo.operatingSystemVersion; v.major = osv.majorVersion; diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index c393609188..b5756af994 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -299,7 +299,7 @@ static inline int qt_safe_close(int fd) #undef QT_CLOSE #define QT_CLOSE qt_safe_close -// - VxWorks & iOS/tvOS don't have processes +// - VxWorks & iOS/tvOS/watchOS don't have processes #if !defined(Q_OS_VXWORKS) && !defined(QT_NO_PROCESS) static inline int qt_safe_execve(const char *filename, char *const argv[], char *const envp[]) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index c1f2dfded4..0413e06665 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -72,7 +72,7 @@ #ifndef QT_NO_QOBJECT #if defined(Q_OS_UNIX) -# if defined(Q_OS_OSX) +# if defined(Q_OS_DARWIN) # include "qeventdispatcher_cf_p.h" # else # if !defined(QT_NO_GLIB) @@ -483,7 +483,7 @@ void QCoreApplicationPrivate::createEventDispatcher() { Q_Q(QCoreApplication); #if defined(Q_OS_UNIX) -# if defined(Q_OS_OSX) +# if defined(Q_OS_DARWIN) bool ok = false; int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok); if (ok && value > 0) diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm index 437e4062ad..eecc72fd94 100644 --- a/src/corelib/kernel/qeventdispatcher_cf.mm +++ b/src/corelib/kernel/qeventdispatcher_cf.mm @@ -51,6 +51,8 @@ #ifdef Q_OS_OSX # include <AppKit/NSApplication.h> +#elif defined(Q_OS_WATCHOS) +# include <WatchKit/WatchKit.h> #else # include <UIKit/UIApplication.h> #endif @@ -75,6 +77,8 @@ QT_USE_NAMESPACE name:nil #ifdef Q_OS_OSX object:[NSApplication sharedApplication]]; +#elif defined(Q_OS_WATCHOS) + object:[WKExtension sharedExtension]]; #else object:[UIApplication sharedApplication]]; #endif |