aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktableview.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-08-11 21:02:01 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-08-14 14:58:14 +0000
commitec6b67a0e15ca271032689bfe94619c298a0a9bf (patch)
tree8635b645f53af734307471c713d13cd128b63d81 /src/quick/items/qquicktableview.cpp
parent218fb96808f9ca4470427f68141eac64d1ad96f6 (diff)
QQuickTableView: be more precise about when to load and unload a column
The current implementation would unload a column/row if the right edge was greater than the right edge of the viewport. At the same time, it would load a column if the left edge was less than the right edge of the viewport. But we did nothing if the edge was exactly at the edge of the viewport. This patch will fix that, so that an edge is seen as either inside or ouside (and never on the edge). By handle this (corner) case, it will be easier to test the layout from the auto test, since a column will either be seen as inside or outside the viewport (and not exactly an the edge in addition). Change-Id: I95fccaa4a1bb583036027d2fc8c6eb4895eeefc8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
-rw-r--r--src/quick/items/qquicktableview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
index 627eb5db71..fd8af19805 100644
--- a/src/quick/items/qquicktableview.cpp
+++ b/src/quick/items/qquicktableview.cpp
@@ -460,19 +460,19 @@ bool QQuickTableViewPrivate::canUnloadTableEdge(Qt::Edge tableEdge, const QRectF
case Qt::LeftEdge:
if (loadedTable.width() <= 1)
return false;
- return loadedTableInnerRect.left() < fillRect.left();
+ return loadedTableInnerRect.left() <= fillRect.left();
case Qt::RightEdge:
if (loadedTable.width() <= 1)
return false;
- return loadedTableInnerRect.right() > fillRect.right();
+ return loadedTableInnerRect.right() >= fillRect.right();
case Qt::TopEdge:
if (loadedTable.height() <= 1)
return false;
- return loadedTableInnerRect.top() < fillRect.top();
+ return loadedTableInnerRect.top() <= fillRect.top();
case Qt::BottomEdge:
if (loadedTable.height() <= 1)
return false;
- return loadedTableInnerRect.bottom() > fillRect.bottom();
+ return loadedTableInnerRect.bottom() >= fillRect.bottom();
}
Q_TABLEVIEW_UNREACHABLE(tableEdge);
return false;