Windows: Fix a crash in Vista style.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Wed, 2 May 2012 12:18:35 +0000 (14:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 2 May 2012 12:53:41 +0000 (14:53 +0200)
Do not query the paintDevice of a backing store that has not
received a resize yet.

Change-Id: I49bf8f7e85c092c5664e5bc507802bd2cd8b62ea
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/widgets/styles/qwindowsxpstyle.cpp

index f9b7939..091b27d 100644 (file)
@@ -731,8 +731,9 @@ void QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData)
             canDrawDirectly = true;
             break;
         case QInternal::Image:
+            // Ensure the backing store has received as resize and is initialized.
             if (QBackingStore *bs = backingStoreForWidget(themeData.widget))
-                if (bs->paintDevice() == enginePaintDevice)
+                if (bs->size().isValid() && bs->paintDevice() == enginePaintDevice)
                     canDrawDirectly = true;
         }
     }