From 9866e4826e7a9e7bc80a0fe6142662da52f75e84 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sun, 29 Dec 2013 09:42:25 +0100 Subject: Remove redundant data from KItemListViewLayouter's ItemInfo struct It is not necessary to save the position of each item as a QPointF because all items in a row will have the same y-coordinate, and all items in a column will have the same x-coordinate. Therefore, we can reduce the number of doubles that we store from (number of items) * 2 to (number of rows) + (number of colums) which is at least 50% less. REVIEW: 114460 --- src/kitemviews/private/kitemlistviewlayouter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/private/kitemlistviewlayouter.h') diff --git a/src/kitemviews/private/kitemlistviewlayouter.h b/src/kitemviews/private/kitemlistviewlayouter.h index a3b0893a1..19b14796d 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.h +++ b/src/kitemviews/private/kitemlistviewlayouter.h @@ -220,6 +220,9 @@ private: qreal m_xPosInc; int m_columnCount; + QVector m_rowOffsets; + QVector m_columnOffsets; + // Stores all item indexes that are the first item of a group. // Assures fast access for KItemListViewLayouter::isFirstGroupItem(). QSet m_groupItemIndexes; @@ -227,7 +230,6 @@ private: qreal m_groupHeaderMargin; struct ItemInfo { - QPointF pos; int column; int row; }; -- cgit v1.3.1