iOS: when in fullscreen, autoresize the view when the device rotates

Tell the view that backs QWindow to autoresize itself when
the superview (view of the root view controller) changes size.
This will typically happen when the device changes orientation.

Change-Id: Ib7c4dff9112d57f60012d3f0837677e09088bcaf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Richard Moe Gustavsen 2012-12-07 15:28:13 +01:00 committed by Tor Arne Vestbø
parent 2d4e96352a
commit 0d9a50380c
1 changed files with 2 additions and 0 deletions

View File

@ -234,9 +234,11 @@ void QIOSWindow::setWindowState(Qt::WindowState state)
case Qt::WindowMaximized:
case Qt::WindowFullScreen:
m_view.frame = toCGRect(QRect(QPoint(0, 0), window()->screen()->availableSize()));
m_view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
break;
default:
m_view.frame = toCGRect(geometry());
m_view.autoresizingMask = UIViewAutoresizingNone;
break;
}
}