diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 3394339..150c212 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -1667,6 +1667,8 @@ void QListViewPrivate::prepareItemsLayout()
 
     //take the size as if there were scrollbar in order to prevent scrollbar to blink
     layoutBounds = QRect(QPoint(), q->maximumViewportSize());
+    qDebug() << __FUNCTION__ << "layoutBounds=" << layoutBounds
+             << "q->size" << q->size();
 
     int frameAroundContents = 0;
     if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents))
@@ -1684,6 +1686,8 @@ void QListViewPrivate::prepareItemsLayout()
 
     layoutBounds.adjust(0, 0, -verticalMargin, -horizontalMargin);
 
+    qDebug() << __FUNCTION__ << "adjusted layoutBounds=" << layoutBounds;
+
     int rowCount = model->columnCount(root) <= 0 ? 0 : model->rowCount(root);
     commonListView->setRowCount(rowCount);
 }
@@ -1715,6 +1719,7 @@ bool QListViewPrivate::doItemsLayout(int delta)
     info.wrap = isWrapping();
     info.flow = flow;
     info.max = max;
+    qDebug() << __FUNCTION__ << "QListViewLayoutInfo=" << layoutBounds;
 
     return commonListView->doBatchedItemLayout(info, max);
 }
@@ -1890,6 +1895,7 @@ void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step)
         horizontalWantsToShow = contentsSize.width() > viewportSize.width() - qq->verticalScrollBar()->width();
     else
         horizontalWantsToShow = contentsSize.width() > viewportSize.width();
+    qDebug() << __FUNCTION__ << "Ct" << contentsSize.width() << "VP" << viewportSize.width();
 
     if (bothScrollBarsAuto && !horizontalWantsToShow) {
         // break the infinite loop described above by setting the range to 0, 0.
@@ -1915,13 +1921,18 @@ void QCommonListViewBase::updateVerticalScrollBar(const QSize &step)
     const QSize viewportSize = qq->contentsRect().size();
 
     bool horizontalWantsToShow = contentsSize.width() > viewportSize.width();
+    qDebug() << __FUNCTION__ << "qq->contentsRect().size()=" << viewportSize
+             << "QCommonListViewBase::contentsSize=" << contentsSize;
     bool verticalWantsToShow;
     if (horizontalWantsToShow)
         verticalWantsToShow = contentsSize.height() > viewportSize.height() - qq->horizontalScrollBar()->height();
     else
         verticalWantsToShow = contentsSize.height() > viewportSize.height();
 
+    qDebug() << __FUNCTION__ << "Ct" << contentsSize.height() << "VP" << viewportSize.height();
+
     if (bothScrollBarsAuto && !verticalWantsToShow) {
+        qDebug() << __FUNCTION__ << "auto break";
         // break the infinite loop described above by setting the range to 0, 0.
         // QAbstractScrollArea will then hide the scroll bar for us
         verticalScrollBar()->setRange(0, 0);
@@ -2157,6 +2168,7 @@ void QListModeViewBase::updateVerticalScrollBar(const QSize &step)
     if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
         && ((flow() == QListView::TopToBottom && !isWrapping())
         || (flow() == QListView::LeftToRight && isWrapping()))) {
+        qDebug() << "QListModeViewBase::updateVerticalScrollBar()";
             const int steps = (flow() == QListView::TopToBottom ? scrollValueMap : segmentPositions).count() - 1;
             if (steps > 0) {
                 const int pageSteps = perItemScrollingPageSteps(viewport()->height(), contentsSize.height(), isWrapping());
@@ -2493,6 +2505,7 @@ void QListModeViewBase::doStaticLayout(const QListViewLayoutInfo &info)
         rect.setRight(segPosition + deltaSegPosition);
         rect.setBottom(segmentPositions.count() == 1 ? flowPosition : info.bounds.bottom());
     }
+    qDebug() << __FUNCTION__ << "contentsSize =" <<  QSize(rect.right(), rect.bottom());
     contentsSize = QSize(rect.right(), rect.bottom());
     // if it is the last batch, save the end of the segments
     if (info.last == info.max) {
@@ -2994,7 +3007,7 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info)
                     deltaSegPosition = 0;
             }
             // We must delay calculation of the seg adjustment, as this item
-            // may have caused a wrap to occur
+            // may have caused a wrap to oyccur
             if (useItemSize) {
                 if (info.flow == QListView::LeftToRight)
                     deltaSegHint = item->h + info.spacing;
@@ -3043,11 +3056,13 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info)
     bool done = (info.last >= rowCount() - 1);
     // resize the content area
     if (done || !info.bounds.contains(item->rect())) {
+        qDebug() << __FUNCTION__ << "contentsSize =" << rect.size();
         contentsSize = rect.size();
         if (info.flow == QListView::LeftToRight)
             contentsSize.rheight() += info.spacing;
         else
             contentsSize.rwidth() += info.spacing;
+        qDebug() << __FUNCTION__ << "contentsSize increased =" << contentsSize;
     }
     if (rect.size().isEmpty())
         return;
@@ -3158,6 +3173,7 @@ void QIconModeViewBase::moveItem(int index, const QPoint &dest)
 
     // resize the contents area
     contentsSize = (QRect(QPoint(0, 0), contentsSize)|QRect(dest, rect.size())).size();
+    qDebug() << __FUNCTION__ << "contentsSize=" << contentsSize;
 
     // mark the item as moved
     if (moved.count() != items.count())
@@ -3215,6 +3231,7 @@ void QIconModeViewBase::updateContentsSize()
     QRect bounding;
     for (int i = 0; i < items.count(); ++i)
         bounding |= items.at(i).rect();
+    qDebug() << __FUNCTION__ << "contentsSize=" << bounding.size();
     contentsSize = bounding.size();
 }
 
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index abdd946..bcbdcd6 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -342,6 +342,10 @@ void QAbstractScrollAreaPrivate::layoutChildren()
     bool needv = (vbarpolicy != Qt::ScrollBarAlwaysOff) && ((vbarpolicy == Qt::ScrollBarAlwaysOn && !vtransient)
                  || ((vbarpolicy == Qt::ScrollBarAsNeeded || vtransient)
                      && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty()));
+    qDebug() << __FUNCTION__ <<  "htransient=" << htransient << "needh=" << needh
+               << hbar->minimum() << hbar->maximum()
+             << "vtransient=" << vtransient << "needv=" << needv
+             << vbar->minimum() << vbar->maximum();
 
     QStyleOption opt(0);
     opt.init(q);
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index 0ea9250..a531de6 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -240,6 +240,10 @@ QAbstractSliderPrivate::~QAbstractSliderPrivate()
 */
 void QAbstractSlider::setRange(int min, int max)
 {
+    qDebug() << __FUNCTION__ << this << orientation() << min << max;
+    if (max) {
+        qDebug("XX");
+    }
     Q_D(QAbstractSlider);
     int oldMin = d->minimum;
     int oldMax = d->maximum;
