Don't automatically create a platform window on content orientation change

The platform window creation is policy is such that native resources are
created only when necessary. Since QWindow already tracks
contentOrientation, there is no reason to implicitly create a platform
window when a content orientation change is reported. This makes
content orientation follow the same convention used by windowState.

Change-Id: Ic9920360791e3e5b2abbc36df631a3e53931835b
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
bb10
Andrew Knight 2013-09-16 17:11:08 +03:00 committed by The Qt Project
parent 1a334f8135
commit 09f9c6e1b9
1 changed files with 2 additions and 4 deletions

View File

@ -956,11 +956,9 @@ void QWindow::reportContentOrientationChange(Qt::ScreenOrientation orientation)
Q_D(QWindow);
if (d->contentOrientation == orientation)
return;
if (!d->platformWindow)
create();
Q_ASSERT(d->platformWindow);
if (d->platformWindow)
d->platformWindow->handleContentOrientationChange(orientation);
d->contentOrientation = orientation;
d->platformWindow->handleContentOrientationChange(orientation);
emit contentOrientationChanged(orientation);
}