From 3bc6d7470a88bf1da12aa768c9527fe08d52757a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 8 Nov 2012 15:09:00 +0100 Subject: iOS: Pass QWindow geometry to initWithFrame on window creation Allows the optimal pattern of setting the geometry of the QWindow before showing (and hence creating) it. Change-Id: I29206b5d9a70df0b01e8df8f7df8f35cced51121 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qioswindow.mm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 59508d83f3..ce0ea6e0e1 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -51,6 +51,11 @@ #include +static CGRect toCGRect(const QRect &rect) +{ + return CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()); +} + @implementation EAGLView + (Class)layerClass @@ -58,11 +63,11 @@ return [CAEAGLLayer class]; } --(id)initWithQIOSWindow:(QIOSWindow *)qioswindow +-(id)initWithQIOSWindow:(QIOSWindow *)window { - if (self = [super init]) { - m_qioswindow = qioswindow; - } + if (self = [super initWithFrame:toCGRect(window->geometry())]) + m_qioswindow = window; + return self; } -- cgit v1.2.3