diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 57092a7..e8bbf1c 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1424,6 +1424,8 @@ void QTreeViewPrivate::adjustViewOptionsForIndex(QStyleOptionViewItem *option, c
 
     option->showDecorationSelected = (selectionBehavior & QTreeView::SelectRows)
                                      || option->showDecorationSelected;
+    qDebug() << __FUNCTION__ << "option->showDecorationSelected=" << option->showDecorationSelected
+             << "option->state=" << option->state ;
 
     QVector<int> logicalIndices; // index = visual index of visible columns only. data = logical index.
     QVector<QStyleOptionViewItem::ViewItemPosition> viewItemPosList; // vector of left/middle/end for each logicalIndex, visible columns only.
@@ -1446,6 +1448,7 @@ void QTreeViewPrivate::adjustViewOptionsForIndex(QStyleOptionViewItem *option, c
 */
 void QTreeView::drawTree(QPainter *painter, const QRegion &region) const
 {
+    qDebug() << __FUNCTION__;
     Q_D(const QTreeView);
     const QVector<QTreeViewItem> viewItems = d->viewItems;
 
@@ -1512,6 +1515,7 @@ void QTreeView::drawTree(QPainter *painter, const QRegion &region) const
             d->paintAlternatingRowColors(painter, &option, y, area.bottom());
         }
     }
+    qDebug() << __FUNCTION__ << '<';
 }
 
 /// ### move to QObject :)
@@ -1602,6 +1606,7 @@ int QTreeViewPrivate::widthHintForIndex(const QModelIndex &index, int hint, cons
 void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
                         const QModelIndex &index) const
 {
+    qDebug() << __FUNCTION__ << index;
     Q_D(const QTreeView);
     QStyleOptionViewItem opt = option;
     const QPoint offset = d->scrollDelayOffset;
@@ -1743,6 +1748,7 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
             }
             // draw background for the branch (selection + alternate row)
             opt.rect = branches;
+            qDebug() << __FUNCTION__ << "b1 a)" << branches;
             style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, this);
 
             // draw background of the item (only alternate row). rest of the background
@@ -1750,6 +1756,7 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
             QStyle::State oldState = opt.state;
             opt.state &= ~QStyle::State_Selected;
             opt.rect.setRect(reverse ? position : i + position, y, width - i, height);
+            qDebug() << __FUNCTION__ << "b1 b)" << opt.rect;
             style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, this);
             opt.state = oldState;
 
@@ -1758,6 +1765,7 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
             if (setClipRect)
                 painter->restore();
         } else {
+            qDebug() << __FUNCTION__ << "b2";
             QStyle::State oldState = opt.state;
             opt.state &= ~QStyle::State_Selected;
             opt.rect.setRect(position, y, width, height);
@@ -1801,6 +1809,7 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
 void QTreeView::drawBranches(QPainter *painter, const QRect &rect,
                              const QModelIndex &index) const
 {
+    qDebug() << __FUNCTION__ << rect << index;
     Q_D(const QTreeView);
     const bool reverse = isRightToLeft();
     const int indent = d->indent;
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index a4ecfc5..c045525 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -273,6 +273,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
         break;
 #endif // QT_NO_PROGRESSBAR
     case PE_IndicatorBranch: {
+        qDebug() << __FUNCTION__ << pe;
         static const int decoration_size = 9;
         int mid_h = opt->rect.x() + opt->rect.width() / 2;
         int mid_v = opt->rect.y() + opt->rect.height() / 2;
@@ -310,6 +311,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
         qDrawShadeRect(p, opt->rect, opt->palette, true, 1, 0, 0);
         break;
     case PE_IndicatorHeaderArrow:
+        qDebug() << __FUNCTION__ << pe;
         if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
             QPen oldPen = p->pen();
             if (header->sortIndicator & QStyleOptionHeader::SortUp) {
@@ -641,13 +643,22 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
         if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
             QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled))
                                       ? QPalette::Normal : QPalette::Disabled;
+            qDebug() << __FUNCTION__ << ">PE_PanelItemViewRow" << vopt->index
+                     << vopt->rect << vopt->text;
             if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
                 cg = QPalette::Inactive;
 
-            if ((vopt->state & QStyle::State_Selected) &&  proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, widget))
+            if ((vopt->state & QStyle::State_Selected) &&  proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, opt, widget)) {
+                qDebug() << vopt->rect << "  -> sel: QPalette::Highlight";
                 p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight));
-            else if (vopt->features & QStyleOptionViewItem::Alternate)
+            } else if (vopt->features & QStyleOptionViewItem::Alternate) {
+                qDebug() << vopt->rect << "  -> QPalette::AlternateBase";
                 p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase));
+            } else {
+                qDebug() << vopt->rect << "  not filled";
+
+            }
+            qDebug() << __FUNCTION__ << "<PE_PanelItemViewRow";
         }
         break;
     case PE_PanelItemViewItem:
@@ -656,22 +667,27 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
                                       ? QPalette::Normal : QPalette::Disabled;
             if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
                 cg = QPalette::Inactive;
-
+qDebug() << __FUNCTION__ << ">PE_PanelItemViewItem" << "showDecorationSelected =" << vopt->showDecorationSelected
+         << "row=" << vopt->index.row() << vopt->rect << "state=" << vopt->state << vopt->text;
             if (vopt->showDecorationSelected && (vopt->state & QStyle::State_Selected)) {
+                qDebug() << "  1) ->QPalette::Highlight";
                 p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight));
             } else {
                 if (vopt->backgroundBrush.style() != Qt::NoBrush) {
                     QPointF oldBO = p->brushOrigin();
                     p->setBrushOrigin(vopt->rect.topLeft());
+                    qDebug() << "  2) backgroundBrush";
                     p->fillRect(vopt->rect, vopt->backgroundBrush);
                     p->setBrushOrigin(oldBO);
                 }
 
                 if (vopt->state & QStyle::State_Selected) {
+                    qDebug() << "  3) ->QPalette::Highlight";
                     QRect textRect = subElementRect(QStyle::SE_ItemViewItemText,  opt, widget);
                     p->fillRect(textRect, vopt->palette.brush(cg, QPalette::Highlight));
                 }
             }
+qDebug() << __FUNCTION__ << "<PE_PanelItemViewItem";
         }
         break;
 #endif //QT_NO_ITEMVIEWS
@@ -683,6 +699,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
     case PE_IndicatorArrowDown:
     case PE_IndicatorArrowRight:
     case PE_IndicatorArrowLeft:
+        qDebug() << __FUNCTION__ << pe;
         {
             if (opt->rect.width() <= 1 || opt->rect.height() <= 1)
                 break;
@@ -2142,6 +2159,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
 
 #ifndef QT_NO_ITEMVIEWS
     case CE_ItemViewItem:
+        qDebug() << __FUNCTION__ << ">CE_ItemViewItem";
         if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
             p->save();
             p->setClipRect(opt->rect);
@@ -2217,6 +2235,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
             }
 
              p->restore();
+             qDebug() << __FUNCTION__ << "<CE_ItemViewItem";
         }
         break;
 
