From c77d3d78e448f519c1770c863bb0fccc6c9b7263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 25 Dec 2012 22:31:43 +0100 Subject: [PATCH] iOS: Move debug background color setting and guard for release builds Change-Id: Ie9131c3dfe16045805b37bf8af9381f4f9929da6 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosviewcontroller.mm | 8 ++++++++ src/plugins/platforms/ios/qtmain.mm | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index a441258f4e..c85058743c 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -48,6 +48,14 @@ @implementation QIOSViewController +- (void)viewDidLoad +{ +#ifdef QT_DEBUG + if (!self.nibName) + self.view.backgroundColor = [UIColor magentaColor]; +#endif +} + -(BOOL)shouldAutorotate { // For now we assume that if the application doesn't listen to orientation diff --git a/src/plugins/platforms/ios/qtmain.mm b/src/plugins/platforms/ios/qtmain.mm index 00bb581535..10c83f4b18 100644 --- a/src/plugins/platforms/ios/qtmain.mm +++ b/src/plugins/platforms/ios/qtmain.mm @@ -58,9 +58,9 @@ extern int qt_main(int argc, char *argv[]); self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; self.window.rootViewController = [[[QIOSViewController alloc] init] autorelease]; - // Aid debugging during development +#ifdef QT_DEBUG self.window.backgroundColor = [UIColor cyanColor]; - self.window.rootViewController.view.backgroundColor = [UIColor magentaColor]; +#endif [self.window makeKeyAndVisible];