aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktableview.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-08-23 13:11:31 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-08-28 10:53:07 +0200
commitda04b1d716617fbe4a2d93dc5a51f38dbd03a5b8 (patch)
tree1d346ddb3262b8f2da1d587ba211f8e876cfd40b /src/quick/items/qquicktableview.cpp
parentcfa2c53bc085c775f8ea8dd907e7cd0538542816 (diff)
QQuickTableView: always relayout after a rebuild
The current logic was based on the idea that if both rowHeight-, and columnWidthProveders were set, we didn't have to relayout the items at the end of a rebuild. Because in that case, the row and column sizes would already be correct after the initial load. This assumption turns out to be false, because the providers are allowed to return -1 to signal that the size of a row or column should use default values (meaning, calculated by TableView). And for those cases, we need to do a relayout at the end of a rebuild. Fixes: QTBUG-77074 Change-Id: I0e0f2fdca1cfa9e98f2a0a2b227c3715c16a70f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
-rw-r--r--src/quick/items/qquicktableview.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
index 83fa11a446..38b38ddfda 100644
--- a/src/quick/items/qquicktableview.cpp
+++ b/src/quick/items/qquicktableview.cpp
@@ -1541,15 +1541,7 @@ void QQuickTableViewPrivate::beginRebuildTable()
void QQuickTableViewPrivate::layoutAfterLoadingInitialTable()
{
- if (rowHeightProvider.isUndefined() || columnWidthProvider.isUndefined()) {
- // Since we don't have both size providers, we need to calculate the
- // size of each row and column based on the size of the delegate items.
- // This couldn't be done while we were loading the initial rows and
- // columns, since during the process, we didn't have all the items
- // available yet for the calculation. So we do it now.
- relayoutTable();
- }
-
+ relayoutTable();
updateAverageEdgeSize();
updateContentWidth();
updateContentHeight();