From 77a8bd1e01251211701fa094278b8ddc23b7e6ba Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 May 2012 14:18:35 +0200 Subject: 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 Reviewed-by: Friedemann Kleint --- src/widgets/styles/qwindowsxpstyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index f9b793978b..091b27d87b 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -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; } } -- cgit v1.2.3