diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index 72a463b..896e292 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -55,6 +55,7 @@
 
 #include <qpainter.h>
 #include <qstyleoption.h>
+#include <qdebug.h>
 
 #ifndef QT_NO_DOCKWIDGET
 
@@ -2087,7 +2088,6 @@ bool QDockAreaLayoutInfo::updateTabBar() const
 {
     if (!tabbed)
         return false;
-
     QDockAreaLayoutInfo *that = const_cast<QDockAreaLayoutInfo*>(this);
 
     if (that->tabBar == 0) {
@@ -2115,16 +2115,20 @@ bool QDockAreaLayoutInfo::updateTabBar() const
         QString title = dw->d_func()->fixedWindowTitle;
         quintptr id = tabId(item);
         if (tab_idx == tabBar->count()) {
+            qDebug() << __FUNCTION__ << "appending" << tab_idx << title;
             tabBar->insertTab(tab_idx, title);
 #ifndef QT_NO_TOOLTIP
             tabBar->setTabToolTip(tab_idx, title);
 #endif
             tabBar->setTabData(tab_idx, id);
         } else if (qvariant_cast<quintptr>(tabBar->tabData(tab_idx)) != id) {
+            qDebug() << __FUNCTION__ << "mismatch at" << tab_idx;
             if (tab_idx + 1 < tabBar->count()
-                    && qvariant_cast<quintptr>(tabBar->tabData(tab_idx + 1)) == id)
+                    && qvariant_cast<quintptr>(tabBar->tabData(tab_idx + 1)) == id) {
+                qDebug() << __FUNCTION__ << "removing" << tab_idx;
                 tabBar->removeTab(tab_idx);
-            else {
+            } else {
+                qDebug() << __FUNCTION__ << "inserting" << tab_idx << title;
                 tabBar->insertTab(tab_idx, title);
 #ifndef QT_NO_TOOLTIP
                 tabBar->setTabToolTip(tab_idx, title);
@@ -2134,6 +2138,7 @@ bool QDockAreaLayoutInfo::updateTabBar() const
         }
 
         if (title != tabBar->tabText(tab_idx)) {
+            qDebug() << __FUNCTION__ << "setting" << tab_idx << title;
             tabBar->setTabText(tab_idx, title);
 #ifndef QT_NO_TOOLTIP
             tabBar->setTabToolTip(tab_idx, title);
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index dfd1f10..5b384bd 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -70,6 +70,12 @@
 QT_BEGIN_NAMESPACE
 
 
+QDebug operator<<(QDebug d, const QTabBarPrivate::Tab &t)
+{
+    d << "tab" << t.text << t.data;
+    return d;
+}
+
 inline static bool verticalTabs(QTabBar::Shape shape)
 {
     return shape == QTabBar::RoundedWest
@@ -408,6 +414,7 @@ int QTabBarPrivate::indexAtPos(const QPoint &p) const
 
 void QTabBarPrivate::layoutTabs()
 {
+    qDebug() << __FUNCTION__ << tabList;
     Q_Q(QTabBar);
     scrollOffset = 0;
     layoutDirty = false;
@@ -687,6 +694,7 @@ void QTabBarPrivate::_q_scrollTabs()
 
 void QTabBarPrivate::refresh()
 {
+    qDebug() << __FUNCTION__  << tabList;
     Q_Q(QTabBar);
 
     // be safe in case a subclass is also handling move with the tabs
@@ -780,6 +788,7 @@ bool QTabBar::drawBase() const
 */
 int QTabBar::addTab(const QString &text)
 {
+    qDebug() << __FUNCTION__ << text;
     return insertTab(-1, text);
 }
 
@@ -818,6 +827,7 @@ int QTabBar::insertTab(int index, const QString &text)
 */
 int QTabBar::insertTab(int index, const QIcon& icon, const QString &text)
 {
+    qDebug() << __FUNCTION__ << index << text;
     Q_D(QTabBar);
     if (!d->validIndex(index)) {
         index = d->tabList.count();
@@ -860,6 +870,7 @@ int QTabBar::insertTab(int index, const QIcon& icon, const QString &text)
  */
 void QTabBar::removeTab(int index)
 {
+    qDebug() << __FUNCTION__ << index;
     Q_D(QTabBar);
     if (d->validIndex(index)) {
 #ifndef QT_NO_SHORTCUT
@@ -918,6 +929,7 @@ void QTabBar::removeTab(int index)
                     d->tabList[newIndex].lastTab = bump;
                 }
             } else {
+                qDebug() << __FUNCTION__  << "emitting currentChanged -1";
                 emit currentChanged(-1);
             }
         } else if (index < d->currentIndex) {
@@ -979,6 +991,7 @@ QString QTabBar::tabText(int index) const
 */
 void QTabBar::setTabText(int index, const QString &text)
 {
+    qDebug() << __FUNCTION__ << index << text;
     Q_D(QTabBar);
     if (QTabBarPrivate::Tab *tab = d->at(index)) {
         tab->text = text;
@@ -1108,6 +1121,7 @@ QString QTabBar::tabWhatsThis(int index) const
 */
 void QTabBar::setTabData(int index, const QVariant & data)
 {
+    qDebug() << __FUNCTION__ << index << data;
     Q_D(QTabBar);
     if (QTabBarPrivate::Tab *tab = d->at(index))
         tab->data = data;
@@ -1131,6 +1145,7 @@ QVariant QTabBar::tabData(int index) const
 */
 QRect QTabBar::tabRect(int index) const
 {
+    // qDebug() << __FUNCTION__ << index;
     Q_D(const QTabBar);
     if (const QTabBarPrivate::Tab *tab = d->at(index)) {
         if (d->layoutDirty)
@@ -1212,6 +1227,7 @@ void QTabBar::setCurrentIndex(int index)
             QAccessible::updateAccessibility(&selectionEvent);
         }
 #endif
+        qDebug() << __FUNCTION__  << index << "emitting currentChanged";
         emit currentChanged(index);
     }
 }
@@ -1261,6 +1277,7 @@ int QTabBar::count() const
  */
 QSize QTabBar::sizeHint() const
 {
+  //  qDebug() << __FUNCTION__;
     Q_D(const QTabBar);
     if (d->layoutDirty)
         const_cast<QTabBarPrivate*>(d)->layoutTabs();
@@ -1276,6 +1293,7 @@ QSize QTabBar::sizeHint() const
 QSize QTabBar::minimumSizeHint() const
 {
     Q_D(const QTabBar);
+//    qDebug() << __FUNCTION__;
     if (d->layoutDirty)
         const_cast<QTabBarPrivate*>(d)->layoutTabs();
     if (!d->useScrollButtons) {
@@ -1510,6 +1528,7 @@ bool QTabBar::event(QEvent *event)
  */
 void QTabBar::resizeEvent(QResizeEvent *)
 {
+    qDebug() << __FUNCTION__;
     Q_D(QTabBar);
     if (d->layoutDirty)
         updateGeometry();
@@ -1626,6 +1645,7 @@ int QTabBarPrivate::calculateNewPosition(int from, int to, int index) const
  */
 void QTabBar::moveTab(int from, int to)
 {
+    qDebug() << __FUNCTION__ << from << to;
     Q_D(QTabBar);
     if (from == to
         || !d->validIndex(from)
@@ -1698,6 +1718,7 @@ void QTabBar::moveTab(int from, int to)
 
     d->layoutWidgets(start);
     update();
+    qDebug() << __FUNCTION__ << "emitting" << "tabMoved";
     emit tabMoved(from, to);
     emit tabLayoutChange();
 }
@@ -1705,6 +1726,7 @@ void QTabBar::moveTab(int from, int to)
 void QTabBarPrivate::slide(int from, int to)
 {
     Q_Q(QTabBar);
+    qDebug() << __FUNCTION__ << from << to;
     if (from == to
             || !validIndex(from)
             || !validIndex(to))
@@ -2093,6 +2115,7 @@ bool QTabBar::tabsClosable() const
 
 void QTabBar::setTabsClosable(bool closable)
 {
+    qDebug() << __FUNCTION__;
     Q_D(QTabBar);
     if (d->closeButtonOnTabs == closable)
         return;
@@ -2194,6 +2217,7 @@ bool QTabBar::expanding() const
 
 void QTabBar::setExpanding(bool enabled)
 {
+    qDebug() << __FUNCTION__ << enabled;
     Q_D(QTabBar);
     if (d->expanding == enabled)
         return;
@@ -2264,6 +2288,7 @@ void QTabBar::setDocumentMode(bool enabled)
 void QTabBar::setTabButton(int index, ButtonPosition position, QWidget *widget)
 {
     Q_D(QTabBar);
+    qDebug() << __FUNCTION__ << index << position << widget;
     if (index < 0 || index >= d->tabList.count())
         return;
     if (widget) {
