diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 690c811..17e5d42 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -141,6 +141,7 @@ QCommonStyle::~QCommonStyle()
 void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
                                  const QWidget *widget) const
 {
+    qDebug() << __FUNCTION__ << pe << widget;
     Q_D(const QCommonStyle);
     switch (pe) {
     case PE_FrameButtonBevel:
@@ -592,11 +593,14 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
 #ifndef QT_NO_LINEEDIT
     case PE_PanelLineEdit:
         if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
+            qDebug() << __FUNCTION__ << "drawing" <<panel->palette.brush(QPalette::Base) << widget;
             p->fillRect(panel->rect.adjusted(panel->lineWidth, panel->lineWidth, -panel->lineWidth, -panel->lineWidth),
                         panel->palette.brush(QPalette::Base));
 
-            if (panel->lineWidth > 0)
+            if (panel->lineWidth > 0) {
+                qDebug() << __FUNCTION__ << proxy() << "drawing PE_FrameLineEdit"  << widget;
                 proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget);
+            }
         }
         break;
 #endif // QT_NO_LINEEDIT
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 7f52d3d..8297f8a 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -243,6 +243,9 @@ static inline bool supportsStateTransition(QStyle::PrimitiveElement element,
     default:
         break;
     }
+    qDebug() << __FUNCTION__ << "element=" << element << "opt=" << option->type
+             << "opt.palette.resolve=" << option->palette.resolve()
+             <<widget << result;
     return result;
 }
 
@@ -280,6 +283,7 @@ static inline bool supportsStateTransition(QStyle::PrimitiveElement element,
 void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,
                                        QPainter *painter, const QWidget *widget) const
 {
+    qDebug() << __FUNCTION__ << element<< widget;
     QWindowsVistaStylePrivate *d = const_cast<QWindowsVistaStylePrivate*>(d_func());
 
     int state = option->state;
@@ -324,6 +328,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
 
                     QWindowsVistaAnimation *anim = qobject_cast<QWindowsVistaAnimation *>(d->animation(styleObject));
                     QWindowsVistaTransition *t = new QWindowsVistaTransition(styleObject);
+                    qDebug() << __FUNCTION__ << "----------- creating transition" << widget;
 
                     // We create separate images for the initial and final transition states and store them in the
                     // Transition object.
@@ -336,10 +341,15 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                     // If we have a running animation on the widget already, we will use that to paint the initial
                     // state of the new transition, this ensures a smooth transition from a current animation such as a
                     // pulsating default button into the intended target state.
-                    if (!anim)
+                    if (!anim) {
+                        qDebug() << ">Drawing start" << widget;
                         proxy()->drawPrimitive(element, styleOption, &startPainter, widget);
-                    else
+                        qDebug() << "<Drawing start";
+                    } else {
+                        qDebug() << ">Drawing anim start" << widget;
                         anim->paint(&startPainter, styleOption);
+                        qDebug() << "<Drawing anim start";
+                    }
 
                     t->setStartImage(startImage);
 
@@ -347,7 +357,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                     // if the style was not animated.
                     styleOption->styleObject = 0;
                     styleOption->state = option->state;
+                    qDebug() << ">Drawing end" << widget;
                     proxy()->drawPrimitive(element, styleOption, &endPainter, widget);
+                    qDebug() << "<Drawing end";
 
 
                     t->setEndImage(endImage);
@@ -402,6 +414,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                     d->startAnimation(t);
                 }
                 styleObject->setProperty("_q_no_animation", false);
+                qDebug() << __FUNCTION__ << "----------- created transition";
             }
 
         } // End of animation part
@@ -525,9 +538,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
     break;
 
     case PE_PanelLineEdit:
+        qDebug() << __FUNCTION__ << element << widget;
         if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
             bool isEnabled = option->state & State_Enabled;
             if (QWindowsXPStylePrivate::isLineEditBaseColorSet(option, widget)) {
+                qDebug() << __FUNCTION__ << "filling with base";
                 painter->fillRect(panel->rect, panel->palette.brush(QPalette::Base));
             } else {
                 int partId = EP_BACKGROUND;
@@ -548,6 +563,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                 int bgType;
                 GetThemeEnumValue(theme.handle(), partId, stateId, TMT_BGTYPE, &bgType);
                 if( bgType == BT_IMAGEFILE ) {
+                    qDebug() << __FUNCTION__ << "BT_IMAGEFILE";
                     d->drawBackground(theme);
                 } else {
                     QBrush fillColor = option->palette.brush(QPalette::Base);
@@ -561,6 +577,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                             fillColor = QBrush(qRgb(GetRValue(bgRef), GetGValue(bgRef), GetBValue(bgRef)));
                         }
                     }
+                    qDebug() << __FUNCTION__ << "fill" << fillColor;
                     painter->fillRect(option->rect, fillColor);
                 }
             }
@@ -572,9 +589,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
 
     case PE_FrameLineEdit:
         if (QWindowsVistaAnimation *anim = qobject_cast<QWindowsVistaAnimation *>(d->animation(styleObject(option)))) {
+            qDebug() << __FUNCTION__ << "PE_FrameLineEdit anim" <<anim << widget;
             anim->paint(painter, option);
         } else {
             QPainter *p = painter;
+            qDebug() << __FUNCTION__ << "PE_FrameLineEdit non-anim" << widget;
             if (QWindowsXPStylePrivate::isItemViewDelegateLineEdit(widget)) {
                 // we try to check if this lineedit is a delegate on a QAbstractItemView-derived class.
                 QPen oldPen = p->pen();
@@ -587,6 +606,8 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                 p->setPen(oldPen);
                 return;
             } else {
+                qDebug() << __FUNCTION__ << "PE_FrameLineEdit theme" << widget
+                         << "pdevt" <<  p->device()->devType();
                 int stateId = ETS_NORMAL;
                 if (!(state & State_Enabled))
                     stateId = ETS_DISABLED;
@@ -603,7 +624,9 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
                 QRegion clipRegion = option->rect;
                 clipRegion -= option->rect.adjusted(2, 2, -2, -2);
                 painter->setClipRegion(clipRegion);
+                qDebug() << __FUNCTION__ << ">drawing theme bg";
                 d->drawBackground(theme);
+                qDebug() << __FUNCTION__ << "<drawing theme bg";
                 painter->restore();
             }
         }
@@ -2413,8 +2436,8 @@ QWindowsVistaStylePrivate::QWindowsVistaStylePrivate() :
 bool QWindowsVistaStylePrivate::transitionsEnabled() const
 {
     BOOL animEnabled = false;
-    if (SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0))
-    {
+    if (!qEnvironmentVariableIsSet("QT_NO_ANIM")
+        && SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0)) {
         if (animEnabled)
             return true;
     }
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index f999d82..1f1de06 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -759,6 +759,7 @@ static QRegion scaleRegion(const QRegion &region, qreal factor)
 */
 bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeData, qreal additionalDevicePixelRatio)
 {
+    qDebug() << __FUNCTION__ ;
     QPainter *painter = themeData.painter;
 
     const QPointF redirectionDelta(painter->deviceMatrix().dx(), painter->deviceMatrix().dy());
@@ -807,6 +808,7 @@ bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeDa
 bool QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeData,
                                                             qreal additionalDevicePixelRatio)
 {
+    qDebug() << __FUNCTION__ ;
     QPainter *painter = themeData.painter;
     QRectF rectF = scaleRect(QRectF(themeData.rect), additionalDevicePixelRatio);
 
@@ -1329,6 +1331,7 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
 void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *option, QPainter *p,
                                     const QWidget *widget) const
 {
+    qDebug() << __FUNCTION__ << pe << widget;
     QWindowsXPStylePrivate *d = const_cast<QWindowsXPStylePrivate*>(d_func());
 
     if (!QWindowsXPStylePrivate::useXP()) {
@@ -1525,6 +1528,7 @@ case PE_Frame:
             p->setPen(oldPen);
             return;
         } else if (qstyleoption_cast<const QStyleOptionFrame *>(option)) {
+            qDebug() << __FUNCTION__ << "initing theme " << widget;
             themeNumber = QWindowsXPStylePrivate::EditTheme;
             partId = EP_EDITTEXT;
             noContent = true;
@@ -1537,6 +1541,7 @@ case PE_Frame:
     }
 
     case PE_PanelLineEdit:
+        qDebug() << __FUNCTION__ << pe << widget;
         if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
             themeNumber = QWindowsXPStylePrivate::EditTheme;
             partId = EP_EDITTEXT;
@@ -1546,6 +1551,7 @@ case PE_Frame:
             stateId = isEnabled ? ETS_NORMAL : ETS_DISABLED;
 
             if (QWindowsXPStylePrivate::isLineEditBaseColorSet(option, widget)) {
+                qDebug() << __FUNCTION__ << "filling with base";
                 p->fillRect(panel->rect, panel->palette.brush(QPalette::Base));
             } else {
                 XPThemeData theme(0, p, themeNumber, partId, stateId, rect);
@@ -1879,11 +1885,14 @@ case PE_Frame:
     }
 
     default:
+        qDebug() << __FUNCTION__ << pe <<"not handled";
         break;
     }
 
     XPThemeData theme(widget, p, themeNumber, partId, stateId, rect);
     if (!theme.isValid()) {
+        if (pe == PE_FrameLineEdit || pe == PE_PanelLineEdit)
+            qDebug() << __FUNCTION__ << pe << "invalid theme" << widget;
         QWindowsStyle::drawPrimitive(pe, option, p, widget);
         return;
     }
@@ -1892,6 +1901,8 @@ case PE_Frame:
     theme.noBorder = noBorder;
     theme.noContent = noContent;
     theme.rotate = rotate;
+    if (pe == PE_FrameLineEdit || pe == PE_PanelLineEdit)
+        qDebug() << __FUNCTION__ << pe <<  "drawing with theme" << widget;
     d->drawBackground(theme);
 }
 
