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:
parent
cc0a114cd6
commit
ed950a8ec1
@ -250,17 +250,10 @@ void QIOSWindow::setWindowState(Qt::WindowState state)
|
|||||||
|
|
||||||
void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
|
void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
|
||||||
{
|
{
|
||||||
if (parentWindow) {
|
UIView *parentView = parentWindow ? reinterpret_cast<UIView *>(parentWindow->winId())
|
||||||
UIView *parentView = reinterpret_cast<UIView *>(parentWindow->winId());
|
: isQtApplication() ? static_cast<QIOSScreen *>(screen())->uiWindow().rootViewController.view : 0;
|
||||||
[parentView addSubview:m_view];
|
|
||||||
} else if (isQtApplication()) {
|
[parentView addSubview:m_view];
|
||||||
for (UIWindow *uiWindow in [[UIApplication sharedApplication] windows]) {
|
|
||||||
if (uiWindow.screen == static_cast<QIOSScreen *>(screen())->uiScreen()) {
|
|
||||||
[uiWindow.rootViewController.view addSubview:m_view];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QIOSWindow::requestActivateWindow()
|
void QIOSWindow::requestActivateWindow()
|
||||||
|
Loading…
Reference in New Issue
Block a user