From 7aa25ad44606c26303e3bd3252a641552565cf4b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 30 Apr 2019 13:04:15 +0200 Subject: QQuickTableView: remove relayoutTable() It was only called from one place. And we can optimize it a bit by moving the contents to the caller. Besides, stray relayouts without rebuilding (RebuildOption::LayoutOnly) is no longer allowed. Change-Id: Id63bd2d71969b81ea999caa9d4d331abf8999704 Reviewed-by: Mitch Curtis --- src/quick/items/qquicktableview.cpp | 17 +++-------------- src/quick/items/qquicktableview_p_p.h | 1 - 2 files changed, 3 insertions(+), 15 deletions(-) (limited to 'src/quick/items') diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index e169ac4aec..17352221d3 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1217,19 +1217,6 @@ bool QQuickTableViewPrivate::isRowHidden(int row) return qFuzzyIsNull(getRowHeight(row)); } -void QQuickTableViewPrivate::relayoutTable() -{ - clearEdgeSizeCache(); - relayoutTableItems(); - syncLoadedTableRectFromLoadedTable(); - enforceTableAtOrigin(); - updateContentWidth(); - updateContentHeight(); - // Return back to updatePolish to loadAndUnloadVisibleEdges() - // since the re-layout might have caused some edges to be pushed - // out, while others might have been pushed in. -} - void QQuickTableViewPrivate::relayoutTableItems() { qCDebug(lcTableViewDelegateLifecycle); @@ -1695,7 +1682,9 @@ void QQuickTableViewPrivate::layoutAfterLoadingInitialTable() // columns, since during the process, we didn't have all the items // available yet for the calculation. So we do it now. The exception // is if we specifically only requested a relayout. - relayoutTable(); + clearEdgeSizeCache(); + relayoutTableItems(); + syncLoadedTableRectFromLoadedTable(); } updateAverageEdgeSize(); diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h index e2a413db2c..748a1478ec 100644 --- a/src/quick/items/qquicktableview_p_p.h +++ b/src/quick/items/qquicktableview_p_p.h @@ -338,7 +338,6 @@ public: bool updateTableRecursive(); bool updateTable(); - void relayoutTable(); void relayoutTableItems(); void layoutVerticalEdge(Qt::Edge tableEdge); -- cgit v1.2.3