Windows: Fix a crash in Vista style.

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>
bb10
Friedemann Kleint 2012-05-02 14:18:35 +02:00 committed by Qt by Nokia
parent af0df2d047
commit 77a8bd1e01
1 changed files with 2 additions and 1 deletions

View 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;
}
}