Add function to check whether or not we're part of an extension on Apple OSes

Change-Id: I308147c752ec9c869db87aa94ccf6c88e0999524
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Tor Arne Vestbø 2018-04-30 15:36:22 +02:00
parent ffc377a529
commit 6ada504475
2 changed files with 7 additions and 0 deletions

View File

@ -161,6 +161,12 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool)
}
#endif // !QT_NO_DEBUG_STREAM
bool qt_apple_isApplicationExtension()
{
static bool isExtension = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSExtension"];
return isExtension;
}
#ifdef Q_OS_MACOS
/*
Ensure that Objective-C objects auto-released in main(), directly or indirectly,

View File

@ -158,6 +158,7 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool);
#endif
Q_CORE_EXPORT void qt_apple_check_os_version();
Q_CORE_EXPORT bool qt_apple_isApplicationExtension();
// --------------------------------------------------------------------------