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 <richard.gustavsen@digia.com>
This commit is contained in:
parent
231796c98d
commit
3bc6d7470a
@ -51,6 +51,11 @@
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user