Fix scrolling to the lowermost visible torrent

Fixes #3221.
PR #16543.
This commit is contained in:
Aleksandr Cupacenko 2022-03-01 06:49:40 +02:00 committed by GitHub
commit 98bdfcef65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1178,8 +1178,8 @@ void TransferListWidget::currentChanged(const QModelIndex &current, const QModel
if (current.isValid()) if (current.isValid())
{ {
torrent = m_listModel->torrentHandle(mapToSource(current)); torrent = m_listModel->torrentHandle(mapToSource(current));
// Scroll Fix // Fix scrolling to the lowermost visible torrent
scrollTo(current); QMetaObject::invokeMethod(this, [this, current] { scrollTo(current); }, Qt::QueuedConnection);
} }
emit currentTorrentChanged(torrent); emit currentTorrentChanged(torrent);
} }