diff options
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 12 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qsysinfo.h | 8 | ||||
-rw-r--r-- | src/corelib/global/qsystemdetection.h | 15 |
4 files changed, 26 insertions, 11 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index dd357e4b15..dc7f492bb1 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1918,6 +1918,8 @@ QSysInfo::MacVersion QSysInfo::macVersion() return QSysInfo::MacVersion(Q_MV_OSX(version.major, version.minor)); #elif defined(Q_OS_IOS) return QSysInfo::MacVersion(Q_MV_IOS(version.major, version.minor)); +#elif defined(Q_OS_TVOS) + return QSysInfo::MacVersion(Q_MV_TVOS(version.major, version.minor)); #else return QSysInfo::MV_Unknown; #endif @@ -2620,9 +2622,9 @@ QString QSysInfo::kernelVersion() to determine the distribution name and returns that. If determining the distribution name failed, it returns "unknown". - \b{Darwin, OS X and iOS note}: this function returns "osx" for OS X - systems, "ios" for iOS systems and "darwin" in case the system could not be - determined. + \b{Darwin, OS X, iOS and tvOS note}: this function returns "osx" for OS X + systems, "ios" for iOS systems, "tvos" for tvOS systems and "darwin" in case + the system could not be determined. \b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and "unknown" otherwise. @@ -2652,6 +2654,8 @@ QString QSysInfo::productType() #elif defined(Q_OS_IOS) return QStringLiteral("ios"); +#elif defined(Q_OS_TVOS) + return QStringLiteral("tvos"); #elif defined(Q_OS_OSX) return QStringLiteral("osx"); #elif defined(Q_OS_DARWIN) @@ -2735,6 +2739,8 @@ QString QSysInfo::prettyProductName() { #if defined(Q_OS_IOS) return QLatin1String("iOS ") + productVersion(); +#elif defined(Q_OS_TVOS) + return QLatin1String("tvOS ") + productVersion(); #elif defined(Q_OS_OSX) // get the known codenames const char *basename = 0; diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 808f433278..38ced26ea4 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -607,7 +607,7 @@ class QDataStream; # define QT_NO_SOCKS5 #endif -#if defined(Q_OS_IOS) +#if defined(QT_PLATFORM_UIKIT) # define QT_NO_PROCESS #endif diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 141d45e0db..143e00a4c3 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -121,6 +121,7 @@ public: #define Q_MV_OSX(major, minor) (major == 10 ? minor + 2 : (major == 9 ? 1 : 0)) #define Q_MV_IOS(major, minor) (QSysInfo::MV_IOS | major << 4 | minor) +#define Q_MV_TVOS(major, minor) (QSysInfo::MV_TVOS | major << 4 | minor) enum MacVersion { MV_None = 0xffff, MV_Unknown = 0x0000, @@ -168,7 +169,12 @@ public: MV_IOS_8_2 = Q_MV_IOS(8, 2), MV_IOS_8_3 = Q_MV_IOS(8, 3), MV_IOS_8_4 = Q_MV_IOS(8, 4), - MV_IOS_9_0 = Q_MV_IOS(9, 0) + MV_IOS_9_0 = Q_MV_IOS(9, 0), + + /* tvOS */ + MV_TVOS = 1 << 9, + MV_TVOS_9_0 = Q_MV_TVOS(9, 0), + MV_TVOS_9_1 = Q_MV_TVOS(9, 1) }; #if defined(Q_OS_MAC) static const MacVersion MacintoshVersion; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index ee4b88cdbb..10f9068d0a 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -101,14 +101,17 @@ # define Q_OS_DARWIN32 # endif # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE -# if defined(TARGET_OS_TV) && TARGET_OS_TV -# define Q_OS_TVOS -# elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH +# if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH # define Q_OS_WATCHOS # else -# // TARGET_OS_IOS is only available in newer SDKs, -# // so assume any other iOS-based platform is iOS for now -# define Q_OS_IOS +# define QT_PLATFORM_UIKIT +# if defined(TARGET_OS_TV) && TARGET_OS_TV +# define Q_OS_TVOS +# else +# // TARGET_OS_IOS is only available in newer SDKs, +# // so assume any other iOS-based platform is iOS for now +# define Q_OS_IOS +# endif # endif # else # // there is no "real" OS X define (rdar://22640089), |