diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 8494c8db91..ddf3d0d849 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -78,6 +78,8 @@
 #include <private/qstyleanimation_p.h>
 #endif
 
+#include <QDebug>
+
 #include <qloggingcategory.h>
 
 #include <limits.h>
@@ -1206,6 +1208,8 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w
     Q_ASSERT(textRect);
     Q_ASSERT(iconRect);
     QRect tr = opt->rect;
+    qDebug() << "QCommonStylePrivate::tabLayout(" << tr
+             << opt;
     bool verticalTabs = opt->shape == QTabBar::RoundedEast
                         || opt->shape == QTabBar::RoundedWest
                         || opt->shape == QTabBar::TriangularEast
@@ -1256,10 +1260,13 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w
         if (!verticalTabs)
             *iconRect = QStyle::visualRect(opt->direction, opt->rect, *iconRect);
         tr.setLeft(tr.left() + tabIconSize.width() + 4);
+        qDebug() << "QCommonStylePrivate::tabLayout(icon=" << iconSize << "->" << tr;
     }
 
-    if (!verticalTabs)
+    if (!verticalTabs) {
         tr = QStyle::visualRect(opt->direction, opt->rect, tr);
+        qDebug() << "QCommonStylePrivate::tabLayout(!verticalTabs=" << tr;
+    }
 
     *textRect = tr;
 }
@@ -1981,6 +1988,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
         break;
     case CE_TabBarTabLabel:
         if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
+            qDebug() << "\nCOmm" << __FUNCTION__ << "CE_TabBarTabLabel" <<  tab->rect
+                     << opt << tab;
             QRect tr = tab->rect;
             bool verticalTabs = tab->shape == QTabBar::RoundedEast
                                 || tab->shape == QTabBar::RoundedWest
@@ -2009,7 +2018,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
             }
             QRect iconRect;
             d->tabLayout(tab, widget, &tr, &iconRect);
+            qDebug() << "tabLayout" << tr << iconRect;
             tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); //we compute tr twice because the style may override subElementRect
+            qDebug() << "subElementRect" << tr;
 
             if (!tab->icon.isNull()) {
                 QPixmap tabIcon = tab->icon.pixmap(tab->iconSize, p->device()->devicePixelRatio(),
@@ -2451,6 +2462,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
 QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
                                    const QWidget *widget) const
 {
+    qDebug() << "QCommonStyle::subElementRect" << opt;
     Q_D(const QCommonStyle);
     QRect r;
     switch (sr) {
@@ -2860,6 +2872,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
         break;
     case SE_TabBarTabText:
         if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
+           qDebug() << __FUNCTION__ << tab->rect << opt << tab;
             QRect dummyIconRect;
             d->tabLayout(tab, widget, &r, &dummyIconRect);
         }
diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp
index a85c40a329..0841e387bd 100644
--- a/src/widgets/styles/qproxystyle.cpp
+++ b/src/widgets/styles/qproxystyle.cpp
@@ -7,6 +7,7 @@
 #include "qproxystyle.h"
 #include "qstylefactory.h"
 #include <private/qstyle_p.h>
+#include <QDebug>
 
 #if !defined(QT_NO_STYLE_PROXY) || defined(QT_PLUGIN)
 
@@ -214,6 +215,7 @@ QSize QProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *optio
 QRect QProxyStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
 {
     Q_D (const QProxyStyle);
+    qDebug() << "QProxyStyle::subElementRect" << option;
     d->ensureBaseStyle();
     return d->baseStyle->subElementRect(element, option, widget);
 }
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 86a174a342..15ff064b8a 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -95,6 +95,7 @@
 #include <QtGui/qscreen.h>
 
 #include <QtCore/private/qduplicatetracker_p.h>
+#include <QDebug>
 
 QT_BEGIN_NAMESPACE
 
@@ -6303,7 +6304,10 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
                         const QFont ruleFont = w ? subRule.font.resolve(w->font()) : subRule.font;
                         tabCopy.fontMetrics = QFontMetrics(ruleFont);
                     }
+                    qDebug() << "QStyleSheetStyle::subElementRect tabCopy.rect=" << tabCopy.rect << tabCopy.text;
                     tabCopy.rect = subRule.contentsRect(r);
+                    qDebug() << "QStyleSheetStyle::subElementRect tabCopy.rect=" << tabCopy.rect
+                             << "\nfrom subRule.contentsRect(r) calling parent";
                     return ParentStyle::subElementRect(se, &tabCopy, w);
                 }
             }
