diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-08-10 14:25:22 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-08-10 15:00:19 +0000 |
commit | 0bd3c9cda678b7e158c6142c1567ac927fde18b9 (patch) | |
tree | 551b1e91b2365c1674f14fdec4bc7a2df7cde4c9 | |
parent | 481ea25bc8aa64e7131edd85a6c871b2a3193f58 (diff) |
QQuickTableView: remove cacheBuffer from the public API
As discussed during API review, remove cacheBuffer from the public API.
The cache buffer was a feature inherited from ListView to avoid loading
a lot of items (and affect performance) when the user started to flick.
But now that TableView has support for reusing items, the point of the
cache buffer is more or less gone. At least we choose to remove it from
the public API until we have better understanding if this is really needed.
Note that the cacheBuffer still plays a small role internally, so we
don't remove it from the implementation. We want to preload an extra row
and column for reuse at start-up, since you often cannot reuse the first
row and column during the first flick (they will still be visible
on the screen).
Change-Id: Ie62835a04ac29a84c9a76151b73fe2f75d9ae844
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
13 files changed, 0 insertions, 38 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index d308621bc6..6a7bc78c4d 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1446,26 +1446,6 @@ void QQuickTableView::setRightMargin(qreal margin) emit rightMarginChanged(); } -int QQuickTableView::cacheBuffer() const -{ - return d_func()->cacheBuffer; -} - -void QQuickTableView::setCacheBuffer(int newBuffer) -{ - Q_D(QQuickTableView); - if (d->cacheBuffer == newBuffer || newBuffer < 0) - return; - - d->cacheBuffer = newBuffer; - - if (newBuffer == 0) - d->unloadBuffer(); - - emit cacheBufferChanged(); - polish(); -} - QJSValue QQuickTableView::rowHeightProvider() const { return d_func()->rowHeightProvider; diff --git a/src/quick/items/qquicktableview_p.h b/src/quick/items/qquicktableview_p.h index ff9a22f9af..1ad74fa438 100644 --- a/src/quick/items/qquicktableview_p.h +++ b/src/quick/items/qquicktableview_p.h @@ -73,7 +73,6 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTableView : public QQuickFlickable Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) - Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) Q_PROPERTY(QJSValue rowHeightProvider READ rowHeightProvider WRITE setRowHeightProvider NOTIFY rowHeightProviderChanged) Q_PROPERTY(QJSValue columnWidthProvider READ columnWidthProvider WRITE setColumnWidthProvider NOTIFY columnWidthProviderChanged) Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged) @@ -106,9 +105,6 @@ public: qreal rightMargin() const; void setRightMargin(qreal margin); - int cacheBuffer() const; - void setCacheBuffer(int newBuffer); - QJSValue rowHeightProvider() const; void setRowHeightProvider(QJSValue provider); @@ -142,7 +138,6 @@ Q_SIGNALS: void bottomMarginChanged(); void leftMarginChanged(); void rightMarginChanged(); - void cacheBufferChanged(); void rowHeightProviderChanged(); void columnWidthProviderChanged(); void modelChanged(); diff --git a/tests/auto/quick/qquicktableview/data/alternatingrowheightcolumnwidth.qml b/tests/auto/quick/qquicktableview/data/alternatingrowheightcolumnwidth.qml index c9fb1031dc..4126dcf405 100644 --- a/tests/auto/quick/qquicktableview/data/alternatingrowheightcolumnwidth.qml +++ b/tests/auto/quick/qquicktableview/data/alternatingrowheightcolumnwidth.qml @@ -55,7 +55,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 } diff --git a/tests/auto/quick/qquicktableview/data/contentwidthheight.qml b/tests/auto/quick/qquicktableview/data/contentwidthheight.qml index 2c9d64c20e..7beab21009 100644 --- a/tests/auto/quick/qquicktableview/data/contentwidthheight.qml +++ b/tests/auto/quick/qquicktableview/data/contentwidthheight.qml @@ -55,7 +55,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 leftMargin: 10 diff --git a/tests/auto/quick/qquicktableview/data/countingtableview.qml b/tests/auto/quick/qquicktableview/data/countingtableview.qml index 73fe4a80da..dd15442a01 100644 --- a/tests/auto/quick/qquicktableview/data/countingtableview.qml +++ b/tests/auto/quick/qquicktableview/data/countingtableview.qml @@ -65,7 +65,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 } Component { diff --git a/tests/auto/quick/qquicktableview/data/forcelayout.qml b/tests/auto/quick/qquicktableview/data/forcelayout.qml index 118abf51ee..af00d06837 100644 --- a/tests/auto/quick/qquicktableview/data/forcelayout.qml +++ b/tests/auto/quick/qquicktableview/data/forcelayout.qml @@ -54,7 +54,6 @@ Item { height: 400 anchors.margins: 1 delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 diff --git a/tests/auto/quick/qquicktableview/data/plaintableview.qml b/tests/auto/quick/qquicktableview/data/plaintableview.qml index 21373e6732..730d779896 100644 --- a/tests/auto/quick/qquicktableview/data/plaintableview.qml +++ b/tests/auto/quick/qquicktableview/data/plaintableview.qml @@ -58,7 +58,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 } diff --git a/tests/auto/quick/qquicktableview/data/qqmllistpropertymodel.qml b/tests/auto/quick/qquicktableview/data/qqmllistpropertymodel.qml index c866af8526..fb0b7516bf 100644 --- a/tests/auto/quick/qquicktableview/data/qqmllistpropertymodel.qml +++ b/tests/auto/quick/qquicktableview/data/qqmllistpropertymodel.qml @@ -55,7 +55,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 } Item { diff --git a/tests/auto/quick/qquicktableview/data/tableviewimplicitsize.qml b/tests/auto/quick/qquicktableview/data/tableviewimplicitsize.qml index 65e4d0861c..13b866f8d2 100644 --- a/tests/auto/quick/qquicktableview/data/tableviewimplicitsize.qml +++ b/tests/auto/quick/qquicktableview/data/tableviewimplicitsize.qml @@ -43,7 +43,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 } diff --git a/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml b/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml index e7a83a5d8b..d4d218f5db 100644 --- a/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml +++ b/tests/auto/quick/qquicktableview/data/usefaultyrowcolumnprovider.qml @@ -55,7 +55,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 columnWidthProvider: function(column) { } diff --git a/tests/auto/quick/qquicktableview/data/userowcolumnprovider.qml b/tests/auto/quick/qquicktableview/data/userowcolumnprovider.qml index e781eb8a7c..bc219e0d78 100644 --- a/tests/auto/quick/qquicktableview/data/userowcolumnprovider.qml +++ b/tests/auto/quick/qquicktableview/data/userowcolumnprovider.qml @@ -55,7 +55,6 @@ Item { anchors.margins: 1 clip: true delegate: tableViewDelegate - cacheBuffer: 0 columnSpacing: 1 rowSpacing: 1 columnWidthProvider: function(column) { return column + 10 } diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 982eed7fe2..eefa0411b7 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -761,7 +761,6 @@ void tst_QQuickTableView::fillTableViewButNothingMore() tableView->setTopMargin(margins.top()); tableView->setRightMargin(margins.right()); tableView->setBottomMargin(margins.bottom()); - tableView->setCacheBuffer(0); WAIT_UNTIL_POLISHED; @@ -933,7 +932,6 @@ void tst_QQuickTableView::flick() tableView->setTopMargin(margins.top()); tableView->setRightMargin(margins.right()); tableView->setBottomMargin(margins.bottom()); - tableView->setCacheBuffer(0); tableView->setReuseItems(reuseItems); tableView->setWidth(margins.left() + (visualColumnCount * cellWidth) - spacing.width()); tableView->setHeight(margins.top() + (visualRowCount * cellHeight) - spacing.height()); @@ -1009,7 +1007,6 @@ void tst_QQuickTableView::flickOvershoot() tableView->setTopMargin(margins.top()); tableView->setRightMargin(margins.right()); tableView->setBottomMargin(margins.bottom()); - tableView->setCacheBuffer(0); tableView->setReuseItems(reuseItems); tableView->setWidth(tableWidth - margins.right() - cellWidth / 2); tableView->setHeight(tableHeight - margins.bottom() - cellHeight / 2); diff --git a/tests/manual/tableview/abstracttablemodel/main.qml b/tests/manual/tableview/abstracttablemodel/main.qml index 52541657df..a9b8da94c6 100644 --- a/tests/manual/tableview/abstracttablemodel/main.qml +++ b/tests/manual/tableview/abstracttablemodel/main.qml @@ -68,7 +68,6 @@ Window { model: tableModel delegate: tableViewDelegate - cacheBuffer: 500 columnSpacing: 1 rowSpacing: 1 } |