From b77749e9973da2199029f1271e55d8b42c0e7d2e Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 19 Nov 2012 21:15:19 +0100 Subject: Account for the item spacing when using QListView::scrollTo() Somehow this bug managed to stay hidden until the introduction of QFusionStyle. Task-number: QTBUG-27675 Change-Id: I86b049b869e9f2951426dc67a485ad7c60ef1403 Reviewed-by: Gabriel de Dietrich --- src/widgets/itemviews/qlistview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 592354836a..63412506cc 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -2546,6 +2546,7 @@ int QListModeViewBase::perItemScrollToValue(int index, int scrollValue, int view if (index < 0) return scrollValue; + itemExtent += spacing(); QVector visibleFlowPositions; visibleFlowPositions.reserve(flowPositions.count() - 1); for (int i = 0; i < flowPositions.count() - 1; i++) { // flowPositions count is +1 larger than actual row count -- cgit v1.2.3