diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 09aec2f484..252740cbab 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1010,12 +1010,12 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption QPainter startPainter(&startImage); stateId = PBS_DEFAULTED; XPThemeData theme(widget, &startPainter, name, partId, stateId, rect); - d->drawBackground(theme); + d->drawBackground(theme, true); // Do not draw on HDC of backing store. QPainter alternatePainter(&alternateImage); theme.stateId = PBS_DEFAULTED_ANIMATING; theme.painter = &alternatePainter; - d->drawBackground(theme); + d->drawBackground(theme, true); // Do not draw on HDC of backing store. pulse->setPrimaryImage(startImage); pulse->setAlternateImage(alternateImage); pulse->setStartTime(QTime::currentTime()); diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index eaeb336a61..c112e62c6c 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -665,7 +665,7 @@ bool QWindowsXPStylePrivate::swapAlphaChannel(const QRect &rect, bool allPixels) - Theme part is flipped (mirrored horizontally) else use drawBackgroundDirectly(). */ -void QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData) +void QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData, bool forceFallback) { if (themeData.rect.isEmpty()) return; @@ -693,14 +693,13 @@ void QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData) dc = static_cast(nativeInterface->nativeResourceForBackingStore("getDC", backingStore )); } - bool useFallback = dc == 0 + const bool useFallback = forceFallback || dc == 0 || painter->opacity() != 1.0 || themeData.rotate || complexXForm || themeData.mirrorVertically || (themeData.mirrorHorizontally && pDrawThemeBackgroundEx == 0) || translucentToplevel; - if (!useFallback) drawBackgroundDirectly(themeData); else diff --git a/src/widgets/styles/qwindowsxpstyle_p.h b/src/widgets/styles/qwindowsxpstyle_p.h index 154fe3386c..44dc8e8bdb 100644 --- a/src/widgets/styles/qwindowsxpstyle_p.h +++ b/src/widgets/styles/qwindowsxpstyle_p.h @@ -312,7 +312,7 @@ public: QRegion region(XPThemeData &themeData); void setTransparency(QWidget *widget, XPThemeData &themeData); - void drawBackground(XPThemeData &themeData); + void drawBackground(XPThemeData &themeData, bool forceFallback = false); void drawBackgroundThruNativeBuffer(XPThemeData &themeData); void drawBackgroundDirectly(XPThemeData &themeData);