From ebe5879723e4cf734a2315ccc9513fd28256f077 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 20 Jan 2022 16:37:28 +0100 Subject: [PATCH] Core: Fix redrawing of the current area in ListItemDelegate If the ItemView is scrolled during the hover animation (e.g. via mouse wheel), the previously stored Item QRect is not valid, anymore. Change-Id: I97b81cf063479a988221142474c9f511d02414d8 Reviewed-by: Christian Stenger --- src/plugins/coreplugin/welcomepagehelper.cpp | 3 +-- src/plugins/coreplugin/welcomepagehelper.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index 0fb8e0fa3c3..42d23773b3c 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -406,7 +406,6 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti m_previousIndex = index; m_blurredThumbnail = QPixmap(); m_startTime.start(); - m_currentArea = rc; m_currentWidget = qobject_cast( const_cast(option.widget)); } @@ -580,7 +579,7 @@ void ListItemDelegate::clickAction(const ListItem *) const void ListItemDelegate::goon() { if (m_currentWidget) - m_currentWidget->viewport()->update(m_currentArea); + m_currentWidget->update(m_previousIndex); } } // namespace Core diff --git a/src/plugins/coreplugin/welcomepagehelper.h b/src/plugins/coreplugin/welcomepagehelper.h index dc3a15a6102..d672a1b7257 100644 --- a/src/plugins/coreplugin/welcomepagehelper.h +++ b/src/plugins/coreplugin/welcomepagehelper.h @@ -159,7 +159,6 @@ protected: private: mutable QPersistentModelIndex m_previousIndex; mutable QElapsedTimer m_startTime; - mutable QRect m_currentArea; mutable QPointer m_currentWidget; mutable QVector> m_currentTagRects; mutable QPixmap m_blurredThumbnail;