summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-05-02 14:18:35 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-02 14:53:41 +0200
commit77a8bd1e01251211701fa094278b8ddc23b7e6ba (patch)
treefb744da6bc577d2665757a68172c1fed44fb9b71 /src/widgets
parentaf0df2d04705368459369c311ffae68f01206f9b (diff)
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>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}
}