iOS: QIOSWindow::setParent()
Change-Id: I1a413d898d10b55a4d0653eae719f5bd909a01ec Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>bb10
parent
4993d3ed6b
commit
029029fa97
|
|
@ -65,6 +65,7 @@ public:
|
|||
void setGeometry(const QRect &rect);
|
||||
|
||||
void setWindowState(Qt::WindowState state);
|
||||
void setParent(const QPlatformWindow *window);
|
||||
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
|
||||
void setVisible(bool visible);
|
||||
|
||||
|
|
|
|||
|
|
@ -324,9 +324,7 @@ QIOSWindow::QIOSWindow(QWindow *window)
|
|||
, m_windowLevel(0)
|
||||
, m_devicePixelRatio(1.0)
|
||||
{
|
||||
if (isQtApplication())
|
||||
[rootViewController().view addSubview:m_view];
|
||||
|
||||
setParent(parent());
|
||||
setWindowState(window->windowState());
|
||||
|
||||
// Retina support: get screen scale factor and set it in the content view.
|
||||
|
|
@ -424,6 +422,16 @@ 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()) {
|
||||
[rootViewController().view addSubview:m_view];
|
||||
}
|
||||
}
|
||||
|
||||
void QIOSWindow::requestActivateWindow()
|
||||
{
|
||||
// Note that several windows can be active at the same time if they exist in the same
|
||||
|
|
|
|||
Loading…
Reference in New Issue