iOS: Simplify QIOSWindow::setParent()

Change-Id: I78c47c6ccdb53045f3fa412b1489e08691d3e195
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Tor Arne Vestbø 2015-01-16 17:56:47 +01:00 committed by Tor Arne Vestbø
parent cc0a114cd6
commit ed950a8ec1

View File

@ -250,17 +250,10 @@ void QIOSWindow::setWindowState(Qt::WindowState state)
void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
{
if (parentWindow) {
UIView *parentView = reinterpret_cast<UIView *>(parentWindow->winId());
[parentView addSubview:m_view];
} else if (isQtApplication()) {
for (UIWindow *uiWindow in [[UIApplication sharedApplication] windows]) {
if (uiWindow.screen == static_cast<QIOSScreen *>(screen())->uiScreen()) {
[uiWindow.rootViewController.view addSubview:m_view];
break;
}
}
}
UIView *parentView = parentWindow ? reinterpret_cast<UIView *>(parentWindow->winId())
: isQtApplication() ? static_cast<QIOSScreen *>(screen())->uiWindow().rootViewController.view : 0;
[parentView addSubview:m_view];
}
void QIOSWindow::requestActivateWindow()