summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosapplicationdelegate.mm
Commit message (Collapse)AuthorAgeFilesLines
* iOS: Ensure UIApplicationMain is started before QApplication by wrapping main()Tor Arne Vestbø2013-02-271-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the typical Qt app the developer will have an existing main() that looks something like: int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); return app.exec(); } To support this, we provide our own 'main' function in the qtmain static library that we link into the application, which calls UIApplicationMain and redirects to the 'main' function of the application after the event loop has started spinning. For this to work, the applications 'main' function needs to manually be renamed 'qt_main' for now. In a later patch, this renaming will happen automatically by redefining main from either a header file, or more likely, from the Makefile created by qmake. For the case of an iOS developer wanting to use Qt in their existing app the main will look something like: int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } This is supported right now by just linking in libqios.a without libqiosmain.a. QGuiApplication should then be created e.g inside the native apps application delegate (but QGuiApplication::exec should not be called). In the future, we plan to but use a wrapper library that brings in all the Qt dependencies into one single static library. This library will not link against qtmain, so there won't be a symbol clash if the -ObjC linker option is used. We should then add the required magic to the future Objective-C convenience wrapper for QML to bring up a QGuiApplication, which would allow using Qt from storyboards and NIBs. This would also be the place to inject our own application delegate into the mix, while proxying the delegate callbacks to the user's application delegate. Change-Id: Iba5ade114b27216be8285f36100fd735a08b9d59 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Set background color of UIWindow and root UIView to burn your eyesTor Arne Vestbø2013-02-271-2/+4
| | | | | | | Convenient to aid debugging during development of the platform plugin. Change-Id: Id429ca95e0452385ee8def1fe4a1bb7de175ba3e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: create top-level UIWindow and UIViewControllerRichard Moe Gustavsen2013-02-271-0/+18
| | | | | | | | Create a UIWIndow with a view controller and a view where we can reparent our QIOSWindow views inside. Change-Id: Ic90707d3ebe1af970a3aa2aa0f8c0f4be192456a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: call UIApplicationMain from event dispatcher, and add application delegateRichard Moe Gustavsen2013-02-271-0/+89
This change will let you call QApplication::exec() instead of UiApplicationMain from main. Also added an application delegate that we will need sooner or later for catching application activation events. Change-Id: I4edba5ce2059a804782d67c160755fc0e2e5267d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>