diff options
| author | Frank Reininghaus <[email protected]> | 2013-12-29 09:42:25 +0100 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-12-29 09:42:25 +0100 |
| commit | 9866e4826e7a9e7bc80a0fe6142662da52f75e84 (patch) | |
| tree | 8d634bd4efdb64110f0e64036438059735caa8bd /src/kitemviews/private/kitemlistviewlayouter.h | |
| parent | 545d872b817a0a91aeb7867f04cc0d912d226da0 (diff) | |
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
Diffstat (limited to 'src/kitemviews/private/kitemlistviewlayouter.h')
| -rw-r--r-- | src/kitemviews/private/kitemlistviewlayouter.h | 4 |
1 files changed, 3 insertions, 1 deletions
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<qreal> m_rowOffsets; + QVector<qreal> m_columnOffsets; + // Stores all item indexes that are the first item of a group. // Assures fast access for KItemListViewLayouter::isFirstGroupItem(). QSet<int> m_groupItemIndexes; @@ -227,7 +230,6 @@ private: qreal m_groupHeaderMargin; struct ItemInfo { - QPointF pos; int column; int row; }; |
