aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktableview_p_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-08-11 15:35:07 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-14 11:51:09 +0000
commitee35b2da3921704c0eac5617687db74f46892632 (patch)
tree45a0e71cc5e20eb8b7c1e9db9a030c78e5d2ba55 /src/quick/items/qquicktableview_p_p.h
parentdea5b8b611e4f1a385e9fe4bee5991fc9adcd888 (diff)
QQuickTableView: remove cacheBuffer from the implementation
After we removed cacheBuffer from the public API, giving the users no way to switch if off, the safest thing is to also remove it from the implementation. The cache buffer can easily load add a lot of hidden items to the view, and the user now has no way to tweak or hinder it. As an example, lets say that you in a ListView can fit 10 items on screen. And then you have a cache buffer set that loads two more items, both on top and below. You then end up with 14 items added to the view. Now, lets consider the same case for TableView, where you show 10x10 items on screen. With the same cache buffer, you end up loading 2x10 items in the background on all sides of the table (pluss 4 items in each corners). This sums up to 96 extra items. This is really bad and unacceptable. It's more performant to just switch the caching off completely. Change-Id: Iddbd78ef1d7c7197eb4a847ec5067184149fe9a0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview_p_p.h')
-rw-r--r--src/quick/items/qquicktableview_p_p.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h
index 5fb5a7a9fd..936d8b8207 100644
--- a/src/quick/items/qquicktableview_p_p.h
+++ b/src/quick/items/qquicktableview_p_p.h
@@ -66,7 +66,6 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcTableViewDelegateLifecycle)
-static const int kDefaultCacheBuffer = 300;
static const qreal kDefaultRowHeight = 50;
static const qreal kDefaultColumnWidth = 50;
@@ -203,10 +202,6 @@ public:
QSizeF cellSpacing = QSizeF(0, 0);
QMarginsF tableMargins;
- int cacheBuffer = kDefaultCacheBuffer;
- QTimer cacheBufferDelayTimer;
- bool hasBufferedItems = false;
-
QQmlTableInstanceModel::ReusableFlag reusableFlag = QQmlTableInstanceModel::Reusable;
bool blockItemCreatedCallback = false;
@@ -297,10 +292,6 @@ public:
void beginRebuildTable();
void endRebuildTable();
- void loadBuffer();
- void unloadBuffer();
- QRectF bufferRect();
-
void invalidateTable();
void invalidateColumnRowPositions();