forked from qt-creator/qt-creator
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 <christian.stenger@qt.io>
This commit is contained in:
@@ -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<QAbstractItemView *>(
|
||||
const_cast<QWidget *>(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
|
||||
|
||||
Reference in New Issue
Block a user