QWidget::showFullScreen fixed for widgets with valid size hint
authorJoerg Bornemann <joerg.bornemann@nokia.com>
Mon, 16 Jul 2012 09:11:06 +0000 (11:11 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 16 Jul 2012 14:30:55 +0000 (16:30 +0200)
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>
src/widgets/kernel/qwidget_qpa.cpp

index 9a31373..3661a08 100644 (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();