diff options
Diffstat (limited to 'src/gui/itemviews/qtreeview.cpp')
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index cbe1d2a..539a642 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -2797,15 +2797,14 @@ int QTreeView::indexRowSizeHint(const QModelIndex &index) const if (isRightToLeft()) { start = (start == -1 ? count - 1 : start); - end = (end == -1 ? 0 : end); + end = 0; } else { start = (start == -1 ? 0 : start); - end = (end == -1 ? count - 1 : end); + end = count - 1; } - int tmp = start; - start = qMin(start, end); - end = qMax(tmp, end); + if (end < start) + qSwap(end, start); int height = -1; QStyleOptionViewItemV4 option = d->viewOptionsV4(); |