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());
- 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;
dc = static_cast<HDC>(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
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);