diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-04-30 13:04:15 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2019-05-08 11:51:14 +0000 |
commit | 7aa25ad44606c26303e3bd3252a641552565cf4b (patch) | |
tree | 43ce554e57dcca0cce72eccdb42c2d2984a499b9 | |
parent | 92fa6adcc5b85f8601a5648d4f8879f3a0c6675f (diff) |
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 <mitch.curtis@qt.io>
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 17 | ||||
-rw-r--r-- | src/quick/items/qquicktableview_p_p.h | 1 |
2 files changed, 3 insertions, 15 deletions
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); |