diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 4a6a7bce4b..8cf82901ce 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));
@@ -5656,12 +5657,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 774eca1018..71adb89579 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -699,6 +699,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 657166fc8d..8deccc6849 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/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 8656ca6c09..65ac7e3a51 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -1412,8 +1412,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;
@@ -1432,6 +1433,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/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 8d7d2a82d5..6b6369568e 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -187,6 +187,7 @@ void QDockWidgetTitleButton::paintEvent(QPaintEvent *)
     }
 
     opt.icon = icon();
+    qDebug() << __FUNCTION__ << objectName()<<  opt.icon << opt.iconSize;
     opt.subControls = 0;
     opt.activeSubControls = 0;
     opt.features = QStyleOptionToolButton::None;
@@ -696,7 +697,7 @@ void QDockWidgetPrivate::updateButtons()
 #endif
     button
         = qobject_cast <QAbstractButton*>(dwLayout->widgetForRole(QDockWidgetLayout::CloseButton));
-    button->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarCloseButton, &opt, q));
+    button->setIcon(q->style()->standardIcon(QStyle::SP_TitleBarCloseButton, &opt, q));    
     button->setVisible(canClose && !hideButtons);
 #ifndef QT_NO_ACCESSIBILITY
     //: Accessible name for button closing a dock widget
