From b073ba57f821b2e79c553f974d9fba2cbb034ee9 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 5 Jul 2016 12:12:45 +0300 Subject: Widgets: use const (and const APIs) more For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: Ia6cad50a10facf6fd4f73d1390edb8642a0aed32 Reviewed-by: Marc Mutz --- src/widgets/itemviews/qlistview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/itemviews/qlistview.cpp') diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 3303aac6ed..0788e0287a 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -2396,9 +2396,9 @@ QPoint QListModeViewBase::initStaticLayout(const QListViewLayoutInfo &info) } else if (info.wrap) { if (info.flow == QListView::LeftToRight) { x = batchSavedPosition; - y = segmentPositions.last(); + y = segmentPositions.constLast(); } else { // flow == QListView::TopToBottom - x = segmentPositions.last(); + x = segmentPositions.constLast(); y = batchSavedPosition; } } else { // not first and not wrap @@ -2613,7 +2613,7 @@ int QListModeViewBase::perItemScrollingPageSteps(int length, int bounds, bool wr int steps = positions.count() - 1; int max = qMax(length, bounds); int min = qMin(length, bounds); - int pos = min - (max - positions.last()); + int pos = min - (max - positions.constLast()); while (pos >= 0 && steps > 0) { pos -= (positions.at(steps) - positions.at(steps - 1)); -- cgit v1.2.3