summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosapplicationdelegate.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qiosapplicationdelegate.mm')
-rw-r--r--src/plugins/platforms/ios/qiosapplicationdelegate.mm31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.mm b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
index 1b3dc18dd7..41a3fff84f 100644
--- a/src/plugins/platforms/ios/qiosapplicationdelegate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
@@ -45,34 +45,13 @@
@implementation QIOSApplicationDelegate
+@synthesize window;
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
Q_UNUSED(application)
Q_UNUSED(launchOptions)
- // If this application delegate is instanciated, it means that
- // this plugin also created UIApplication. We then also create a
- // window with a view controller, and set all QWindow views
- // as children of the controller view:
- self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
- UIViewController *controller = [[UIViewController alloc] init];
- self.window.rootViewController = controller;
- controller.view = [[UIView alloc] init];
-
- QWindowList windows = QGuiApplication::topLevelWindows();
- for (int i=0; i<windows.size(); ++i) {
- if (QIOSWindow *w = static_cast<QIOSWindow *>(windows[i]->handle())) {
- UIView *winView = w->nativeView();
- if (winView && !winView.superview)
- [controller.view addSubview:winView];
- }
- }
-
- // Aid debugging during development
- self.window.backgroundColor = [UIColor cyanColor];
- controller.view.backgroundColor = [UIColor magentaColor];
-
- [self.window makeKeyAndVisible];
return YES;
}
@@ -104,6 +83,12 @@
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
+- (void)dealloc
+{
+ [window release];
+ [super dealloc];
+}
+
@end