diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 62b6a6831f..6f87eedb72 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -114,6 +114,8 @@
 #include <private/qstyleanimation_p.h>
 #endif
 
+#include <QDebug>
+
 #include <limits.h>
 
 #include <private/qtextengine_p.h>
@@ -1220,6 +1222,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
@@ -1270,10 +1274,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;
 }
@@ -1990,6 +1997,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
@@ -2018,7 +2027,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(qt_getWindow(widget), tab->iconSize,
@@ -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 e50cf861c8..28c8fecb1d 100644
--- a/src/widgets/styles/qproxystyle.cpp
+++ b/src/widgets/styles/qproxystyle.cpp
@@ -43,6 +43,7 @@
 #include "qproxystyle.h"
 #include "qstylefactory.h"
 #include <private/qstyle_p.h>
+#include <QDebug>
 
 #if !defined(QT_NO_STYLE_PROXY) || defined(QT_PLUGIN)
 
@@ -241,6 +242,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 f5c5ddba05..db2ae5ec7f 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -6071,7 +6071,10 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
                     const QRect optRect = bar && tab->tabIndex != -1 ? bar->tabRect(tab->tabIndex) : opt->rect;
                     const QRect r = positionRect(w, subRule, PseudoElement_TabBarTab, optRect, opt->direction);
                     QStyleOptionTabV4 tabCopy(*tab);
+                    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);
                 }
             }
