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 GitHub
parent d41012a285
commit bb97817f35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -1306,9 +1306,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

@ -111,7 +111,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;