Fix screen reader accessibility in torrent list

PR #23359.
Closes #20393.
This commit is contained in:
Andrew Johnson 2025-10-15 04:10:53 -04:00 committed by Vladimir Golovnev (Glassez)
parent 571094cc9c
commit ba7c7e283e
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
2 changed files with 9 additions and 2 deletions

View File

@ -1285,9 +1285,16 @@ void TransferListWidget::displayListMenu()
listMenu->popup(QCursor::pos());
}
void TransferListWidget::currentChanged(const QModelIndex &current, const QModelIndex&)
void TransferListWidget::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
qDebug("CURRENT CHANGED");
// Call base class to ensure Qt's accessibility system is notified of focus changes.
// This is critical for screen readers to announce the currently selected torrent.
// Without this call, users relying on assistive technologies cannot effectively
// navigate the torrent list with keyboard arrow keys.
QTreeView::currentChanged(current, previous);
BitTorrent::Torrent *torrent = nullptr;
if (current.isValid())
{

View File

@ -110,7 +110,7 @@ private slots:
void torrentDoubleClicked();
void displayListMenu();
void displayColumnHeaderMenu();
void currentChanged(const QModelIndex &current, const QModelIndex&) override;
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
void setSelectedTorrentsSuperSeeding(bool enabled) const;
void setSelectedTorrentsSequentialDownload(bool enabled) const;
void setSelectedFirstLastPiecePrio(bool enabled) const;