From bb97817f35a20e5e3b94b19ad6e60f0c9978c6d2 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 15 Oct 2025 04:10:53 -0400 Subject: [PATCH] Fix screen reader accessibility in torrent list PR #23359. Closes #20393. --- src/gui/transferlistwidget.cpp | 9 ++++++++- src/gui/transferlistwidget.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index c0a93e938..bae2a51e0 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -1306,9 +1306,16 @@ void TransferListWidget::displayListMenu() listMenu->popup(QCursor::pos()); } -void TransferListWidget::currentChanged(const QModelIndex ¤t, const QModelIndex&) +void TransferListWidget::currentChanged(const QModelIndex ¤t, 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()) { diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index f1bbf4141..e6831d246 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -111,7 +111,7 @@ private slots: void torrentDoubleClicked(); void displayListMenu(); void displayColumnHeaderMenu(); - void currentChanged(const QModelIndex ¤t, const QModelIndex&) override; + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; void setSelectedTorrentsSuperSeeding(bool enabled) const; void setSelectedTorrentsSequentialDownload(bool enabled) const; void setSelectedFirstLastPiecePrio(bool enabled) const;