diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index 22c91db7ca..c1fd6d9a34 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -1416,8 +1416,9 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
             stateId = PBS_NORMAL;
         break;
 
-    case PE_PanelButtonTool:
+    case PE_PanelButtonTool:        
         if (widget && widget->inherits("QDockWidgetTitleButton")) {
+            qDebug() << __FUNCTION__ << "PE_PanelButtonTool" << widget;
             if (const QWidget *dw = widget->parentWidget())
                 if (dw->isWindow())
                     return;
@@ -1436,6 +1437,8 @@ void QWindowsXPStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt
             stateId = TS_HOT;
         else
             stateId = TS_NORMAL;
+        qDebug() << __FUNCTION__ << "part=" << partId
+           <<         "stateId=" << stateId ;
         break;
 
     case PE_IndicatorButtonDropDown:
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 1155257664..aec264db00 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -181,6 +181,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
     case PE_PanelButtonBevel:
     case PE_PanelButtonTool:
     case PE_IndicatorButtonDropDown:
+        qDebug() << __FUNCTION__ << "PE_PanelButtonTool" << widget;
         qDrawShadePanel(p, opt->rect, opt->palette,
                         opt->state & (State_Sunken | State_On), 1,
                         &opt->palette.brush(QPalette::Button));
@@ -5664,12 +5665,14 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti
     case SP_TitleBarUnshadeButton:
         return cachedPixmapFromXPM(qt_unshade_xpm);
     case SP_TitleBarNormalButton:
+        qDebug() << __FUNCTION__ << "SP_TitleBarNormalButton qt_normalizeup_xpm";
         return cachedPixmapFromXPM(qt_normalizeup_xpm);
     case SP_TitleBarMinButton:
         return cachedPixmapFromXPM(qt_minimize_xpm);
     case SP_TitleBarMaxButton:
         return cachedPixmapFromXPM(qt_maximize_xpm);
     case SP_TitleBarCloseButton:
+        qDebug() << __FUNCTION__ << "SP_TitleBarCloseButton qt_close_xpm";
         return cachedPixmapFromXPM(qt_close_xpm);
     case SP_TitleBarContextHelpButton:
         return cachedPixmapFromXPM(qt_help_xpm);
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index c01fb9e0db..ef3fb95e5a 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -676,6 +676,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
         painter->save();
         if ((option->state & State_Enabled || option->state & State_On) || !(option->state & State_AutoRaise)) {
             if (widget && widget->inherits("QDockWidgetTitleButton")) {
+                qDebug() << __FUNCTION__ << "PE_PanelButtonTool" << widget;
                 if (option->state & State_MouseOver)
                     proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget);
             } else {
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 7a84a4dcf8..9483f7a6f9 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -727,6 +727,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
         QPen oldPen = p->pen();
 #if QT_CONFIG(dockwidget)
         if (w && w->inherits("QDockWidgetTitleButton")) {
+            qDebug() << __FUNCTION__ << "PE_PanelButtonTool" << w;
            if (const QWidget *dw = w->parentWidget())
                 if (dw->isWindow()){
                     qDrawWinButton(p, opt->rect.adjusted(1, 1, 0, 0), opt->palette, opt->state & (State_Sunken | State_On),
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 26060052d3..a1a4e679c5 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -182,12 +182,14 @@ void QDockWidgetTitleButton::paintEvent(QPaintEvent *)
     }
 
     opt.icon = icon();
+    qDebug() << __FUNCTION__ << objectName()<<  opt.icon;
     opt.subControls = 0;
     opt.activeSubControls = 0;
     opt.features = QStyleOptionToolButton::None;
     opt.arrowType = Qt::NoArrow;
     int size = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this);
     opt.iconSize = QSize(size, size);
+     qDebug() << __FUNCTION__ <<  "opt.iconSize (QStyle::PM_SmallIconSize)=" << opt.iconSize ;
     style()->drawComplexControl(QStyle::CC_ToolButton, &opt, &p, this);
 }
 
