summaryrefslogtreecommitdiff
blob: 711850aba8ea424f9d02c1f4bb2263d9436d73fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index b797776..40b51fe 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -3435,6 +3435,10 @@ void QTreeViewPrivate::updateScrollBars()
     if (!viewportSize.isValid())
         viewportSize = QSize(0, 0);
 
+    if (viewItems.isEmpty()) {
+        q->doItemsLayout();
+    }
+
     int itemsInViewport = 0;
     if (uniformRowHeights) {
         if (defaultItemHeight <= 0)