mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
For very large tables, don't fallback to rendering all rows
* lastRow can return -1 in some situations where there's no last row visible, but we don't want to render potentially millions of invisible rows.
This commit is contained in:
@@ -233,7 +233,11 @@ void RDTableView::paintEvent(QPaintEvent *e)
|
||||
int firstRow = qMax(verticalHeader()->visualIndexAt(0), 0);
|
||||
int lastRow = verticalHeader()->visualIndexAt(viewport()->height());
|
||||
if(lastRow < 0)
|
||||
lastRow = verticalHeader()->count() - 1;
|
||||
{
|
||||
// if lastRow is negative, display as many will fit. This is a reasonable upper bound without
|
||||
// displaying all rows which could be massive
|
||||
lastRow = firstRow + (viewport()->height() / qMax(1, rowHeight(firstRow))) + 1;
|
||||
}
|
||||
lastRow = qMin(lastRow, verticalHeader()->count() - 1);
|
||||
|
||||
int firstCol = qMax(horizontalHeader()->visualIndexAt(horizontalHeader()->pinnedWidth() + 1), 0);
|
||||
|
||||
Reference in New Issue
Block a user