From e518cea0cf91056fe7ff391b916623fb0654dff4 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Wed, 30 Oct 2013 17:39:20 +0100 Subject: Prevent storing some redundant data in KItemListViewLayouter In KItemListViewLayouter, we have always stored a QRectF for each item, which is "the area that the item occupies". However, the size of the QRectF is already stored in the size hint resolver. Therefore, it is sufficient to store the position of the top left corner of the QRectF in a QPointF and construct the QRectF on demand. This patch reduces the memory usage by 16 bytes for each item in the view: * a QRectF is 4 doubles -> 32 byes * a QPointF contains only 2 doubles -> 16 bytes REVIEW: 113487 --- src/kitemviews/private/kitemlistviewlayouter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kitemviews/private/kitemlistviewlayouter.h') diff --git a/src/kitemviews/private/kitemlistviewlayouter.h b/src/kitemviews/private/kitemlistviewlayouter.h index 306fcd360..a3b0893a1 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.h +++ b/src/kitemviews/private/kitemlistviewlayouter.h @@ -227,7 +227,7 @@ private: qreal m_groupHeaderMargin; struct ItemInfo { - QRectF rect; + QPointF pos; int column; int row; }; -- cgit v1.3.1