From 8de62d34321cd827e60b0a7b6e7434070de301ae Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Mon, 23 Dec 2019 15:44:48 +0100 Subject: QAbstractItemView::dataChanged(): optimize call to QWidget::update() When topLeft and bottomRight are different in QAIV::dataChanged(), the current implementation simply calls QWidget::update() without checking if the affected cells are visible. This results in a big performance hit when cells are updated frequently. Now try to compute the exact update rect by iterating through the modified indexes. Fixes: QTBUG-58580 Change-Id: I97de567d494e40ed8cdb1ea1f5b3cf3a2f60455e Reviewed-by: Samuel Gaist --- src/widgets/itemviews/qabstractitemview_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/itemviews/qabstractitemview_p.h') diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index fe1c00248f..4b29b68b66 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -108,6 +108,7 @@ public: virtual void _q_layoutChanged(); virtual void _q_rowsMoved(const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &destination, int destinationStart); virtual void _q_columnsMoved(const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &destination, int destinationStart); + virtual QRect intersectedRect(const QRect rect, const QModelIndex &topLeft, const QModelIndex &bottomRight) const; void _q_headerDataChanged() { doDelayedItemsLayout(); } void _q_scrollerStateChanged(); -- cgit v1.2.3