diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index a4ecfc5..99179fe 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -1072,6 +1072,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget
     Q_ASSERT(textRect);
     Q_ASSERT(iconRect);
     QRect tr = opt->rect;
+    qDebug() << "QCommonStylePrivate" << __FUNCTION__ << "textRect=" << *textRect<< "tr=" <<tr;
     bool verticalTabs = opt->shape == QTabBar::RoundedEast
                         || opt->shape == QTabBar::RoundedWest
                         || opt->shape == QTabBar::TriangularEast
@@ -1083,6 +1084,9 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget
     int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget);
     int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
     int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2;
+    qDebug() << "QCommonStylePrivate" << __FUNCTION__
+             << "horizontalShift=" << horizontalShift
+             << "hpadding=" << hpadding;
     if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth)
         verticalShift = -verticalShift;
     tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding);
@@ -1123,8 +1127,11 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget
         tr.setLeft(tr.left() + tabIconSize.width() + 4);
     }
 
-    if (!verticalTabs)
+    if (!verticalTabs) {
+        const QRect olr = tr;
         tr = proxyStyle->visualRect(opt->direction, opt->rect, tr);
+        qDebug() << proxyStyle->objectName() << "visualRect:" << olr << "->" << tr;
+    }
 
     *textRect = tr;
 }
@@ -1845,6 +1852,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
         if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
             QStyleOptionTabV3 tabV2(*tab);
             QRect tr = tabV2.rect;
+            qDebug() << "QCommonStyle"<< __FUNCTION__ << tr;
             bool verticalTabs = tabV2.shape == QTabBar::RoundedEast
                                 || tabV2.shape == QTabBar::RoundedWest
                                 || tabV2.shape == QTabBar::TriangularEast
@@ -1883,6 +1891,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
                 p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon);
             }
 
+            qDebug() << "common" << __FUNCTION__ << tab->text << "at " << tr
+                      << "FFRAME=" << (tabV2.state & State_HasFocus);
             proxy()->drawItemText(p, tr, alignment, tab->palette, tab->state & State_Enabled, tab->text, QPalette::WindowText);
             if (verticalTabs)
                 p->restore();
@@ -2305,6 +2315,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
                                    const QWidget *widget) const
 {
     Q_D(const QCommonStyle);
+    qDebug() << "QCommonStyle" << __FUNCTION__ << sr;
     QRect r;
     switch (sr) {
     case SE_PushButtonContents:
@@ -2712,6 +2723,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
         if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
             QStyleOptionTabV3 tabV3(*tab);
             QRect dummyIconRect;
+            qDebug() << "QCommonStyle" << __FUNCTION__ << "SE_TabBarTabText" << r;
             d->tabLayout(&tabV3, widget, &r, &dummyIconRect);
         }
         break;
@@ -3026,6 +3038,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
     default:
         break;
     }
+    qDebug() << "QCommonStyle" << __FUNCTION__ << sr << "returns " << r;
     return r;
 }
 
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 0143337..a64f42f 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4013,9 +4013,12 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
             QFont oldFont = p->font();
             if (subRule.hasFont)
                 p->setFont(subRule.font);
+            qDebug() << "ststyle" << __FUNCTION__ << (subRule.hasBox() || !subRule.hasNativeBorder());
             if (subRule.hasBox() || !subRule.hasNativeBorder()) {
                 tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r)
                                                        : subRule.contentsRect(r);
+                if (tabCopy.rect != tab->rect)
+                    qDebug() << "!!!!!!!!!!!!! -> QStyleSheetStyle" << __FUNCTION__ << "changed rect" << tab->rect << tabCopy.rect;
                 QWindowsStyle::drawControl(ce, &tabCopy, p, w);
             } else {
                 baseStyle()->drawControl(ce, &tabCopy, p, w);
@@ -5578,6 +5581,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
 
 QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, const QWidget *w) const
 {
+    qDebug() << "ststyle" << __FUNCTION__ << se;
     RECURSION_GUARD(return baseStyle()->subElementRect(se, opt, w))
 
     QRenderRule rule = renderRule(w, opt);
@@ -5771,8 +5775,11 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
     case SE_TabBarTabLeftButton:
     case SE_TabBarTabRightButton: {
         QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab);
+        qDebug() << "ststyle" << __FUNCTION__ << "rule=" << (subRule.hasBox() || !subRule.hasNativeBorder());
         if (subRule.hasBox() || !subRule.hasNativeBorder()) {
-            return ParentStyle::subElementRect(se, opt, w);
+            QRect r = ParentStyle::subElementRect(se, opt, w);
+            qDebug() << "ststyle" << __FUNCTION__ << se << "from parent" << r;
+            return r;
         }
         break;
     }
@@ -5818,7 +5825,9 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
         break;
     }
 
-    return baseStyle()->subElementRect(se, opt, w);
+    QRect br = baseStyle()->subElementRect(se, opt, w);
+    qDebug() << "ststyle" << __FUNCTION__ << se << "from base" << baseStyle()->objectName() << br;
+    return br;
 }
 
 bool QStyleSheetStyle::event(QEvent *e)
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index bed2b5c..c82fdbf 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -1865,6 +1865,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
 /*! \reimp */
 QRect QWindowsStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *w) const
 {
+    qDebug() << "QWindowsStyle" << __FUNCTION__ << sr;
     QRect r;
     switch (sr) {
     case SE_SliderFocusRect:
@@ -1892,8 +1893,10 @@ QRect QWindowsStyle::subElementRect(SubElement sr, const QStyleOption *opt, cons
         r.adjust(3, 3, -3, -3);
         break;
     default:
+        qDebug() << "QWindowsStyle calling QCommonStyle";
         r = QCommonStyle::subElementRect(sr, opt, w);
     }
+    qDebug() << "QWindowsStyle" << __FUNCTION__ << sr << "returns" <<r;
     return r;
 }
 
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 02c34d9..36450ad 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -137,6 +137,7 @@ void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
     option->initFrom(this);
     option->state &= ~(QStyle::State_HasFocus | QStyle::State_MouseOver);
     option->rect = tabRect(tabIndex);
+    qDebug() << __FUNCTION__ << "tabIndex=" << tabIndex<< "option->rect=" << option->rect;
     bool isCurrent = tabIndex == d->currentIndex;
     option->row = 0;
     if (tabIndex == d->pressedIndex)
@@ -197,9 +198,13 @@ void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
     }
 #endif
 
+
+    qDebug() << __FUNCTION__ << "tabIndex=" << tabIndex<< "Calling subElementRect>>>>>>>";
     QRect textRect = style()->subElementRect(QStyle::SE_TabBarTabText, option, this);
+    qDebug() << __FUNCTION__ << "tabIndex=" << tabIndex<< textRect << "Called subElementRect<<<<<<<<<";
     option->text = fontMetrics().elidedText(option->text, d->elideMode, textRect.width(),
                         Qt::TextShowMnemonic);
+    qDebug() << __FUNCTION__ << "-->" << option->text;
 }
 
 /*!
@@ -1156,6 +1161,7 @@ QVariant QTabBar::tabData(int index) const
 QRect QTabBar::tabRect(int index) const
 {
     Q_D(const QTabBar);
+    qDebug() << "QTabBar" << __FUNCTION__ << index << ">>>>>>>>>";
     if (const QTabBarPrivate::Tab *tab = d->at(index)) {
         if (d->layoutDirty)
             const_cast<QTabBarPrivate*>(d)->layoutTabs();
@@ -1166,6 +1172,7 @@ QRect QTabBar::tabRect(int index) const
             r.translate(-d->scrollOffset, 0);
         if (!verticalTabs(d->shape))
             r = QStyle::visualRect(layoutDirection(), rect(), r);
+        qDebug() << "QTabBar" << __FUNCTION__ << index << "returns" << r;
         return r;
     }
     return QRect();
@@ -1593,8 +1600,10 @@ void QTabBar::paintEvent(QPaintEvent *)
         p.drawPrimitive(QStyle::PE_FrameTabBarBase, optTabBase);
 
     for (int i = 0; i < d->tabList.count(); ++i) {
+        qDebug() << __FUNCTION__ << "loop" << i;
         QStyleOptionTabV3 tab;
         initStyleOption(&tab, i);
+
         if (d->paintWithOffsets && d->tabList[i].dragOffset != 0) {
             if (vertical) {
                 tab.rect.moveTop(tab.rect.y() + d->tabList[i].dragOffset);
@@ -1602,6 +1611,7 @@ void QTabBar::paintEvent(QPaintEvent *)
                 tab.rect.moveLeft(tab.rect.x() + d->tabList[i].dragOffset);
             }
         }
+        qDebug() << __FUNCTION__ << i << tab.rect;
         if (!(tab.state & QStyle::State_Enabled)) {
             tab.palette.setCurrentColorGroup(QPalette::Disabled);
         }
@@ -1621,7 +1631,9 @@ void QTabBar::paintEvent(QPaintEvent *)
         if (i == selected)
             continue;
 
+        qDebug() << __FUNCTION__ << i << "calling drawControl(QStyle::CE_TabBarTab: " << tab.rect;
         p.drawControl(QStyle::CE_TabBarTab, tab);
+        qDebug() << __FUNCTION__ << i << "called drawControl(QStyle::CE_TabBarTab: ";
     }
 
     // Draw the selected tab last to get it "on top"
