QWidget::showFullScreen fixed for widgets with valid size hint

Ensure the initial size is valid, since we store it as normalGeometry
below.

Task-number: QTBUG-26226
Change-Id: I3a55c389a48504699942930063089c80657687a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
bb10
Joerg Bornemann 2012-07-16 11:11:06 +02:00 committed by Qt by Nokia
parent a89c7e4020
commit 855bac6368
1 changed files with 4 additions and 0 deletions

View File

@ -612,6 +612,10 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
Qt::WindowState newEffectiveState = effectiveState(newstate);
Qt::WindowState oldEffectiveState = effectiveState(oldstate);
if (isWindow() && newEffectiveState != oldEffectiveState) {
// Ensure the initial size is valid, since we store it as normalGeometry below.
if (!testAttribute(Qt::WA_Resized) && !isVisible())
adjustSize();
d->createTLExtra();
if (oldEffectiveState == Qt::WindowNoState)
d->topData()->normalGeometry = geometry();