qt5base-lts/mkspecs/features/mac
Gabriel de Dietrich 1e14762b8d Make QGuiApplication::exec() run within NSApplicationMain()
We follow the same pattern as for iOS and Windows ports, making
sure the user's main() runs in a platform friendly environment. In
this particular case, it means calling the user's main() during the
call of NSApplicationMain(), and calling the user's main() function
(renamed to qMain() as in Windows) after receiving
NSApplicationDidFinishLaunchingNotification. In practice, this means
that NSApp is running when qMain() is called, and therefore when
QCoreApplication::exec() is called.

For those command-line utilities running on QGuiApplication, or any
deriving class, and that do not provide a bundle, we override the main
bundle's dictionary and get NSApplicationMain() to run as usual.

Added cocoa/cocoamain "subdir" to build libqtcocoamain.a (together with
cocoa/cocoaplugin -- plugins/platforms/cocoa is made a subdirs project).
This library is linked against all GUI Qt apps and provides the actual
main() function. It also catches the launching NSApplication notifications,
and calls the user's qMain() function. Note that this will happen in the
same cases when the user's application will run with the Cocoa QPA plugin.

Launch related code in QCocoaApplicationDelegate is moved to libqtcocoamain,
QNSApplication is removed (but sendEvent: redirection still there), and
code in QCocoaEventDispatcher dealing with calling [NSApp run] and related
has been removed since it's become unreachable.

ChangeLog: [Qt for Mac] Make QGuiApplication::exec() run within NSApplicationMain()
Change-Id: I790e5138c29aac2e0215a9147d0148fece40ca22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-08-29 12:44:07 +02:00
..
default_post.prf Make QGuiApplication::exec() run within NSApplicationMain() 2013-08-29 12:44:07 +02:00
default_pre.prf Cache Xcode and SDK settings in .qmake.cache if it exists 2013-05-08 14:07:41 +02:00
objective_c.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
rez.prf Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
sdk.prf Scope cached Mac SDK tool values by mkspec 2013-06-24 18:22:34 +02:00