diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index f3e0e06a56..502d64eaf6 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -3347,7 +3347,7 @@ void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninit model->fetchMore(parent); // guestimate the number of items in the viewport, and fetch as many as might fit const int itemHeight = defaultItemHeight <= 0 ? q->sizeHintForRow(0) : defaultItemHeight; - const int viewCount = viewport->height() / itemHeight; + const int viewCount = itemHeight ? viewport->height() / itemHeight : 0; int lastCount = -1; while ((count = model->rowCount(parent)) < viewCount && count != lastCount && model->canFetchMore(parent)) { |