Commit 5df7ff9e authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add workaround for a bug in QListView::currentChanged

QListView::currentChanged sends an accessible focus event even if the
list view doesn't have focus. In this case the current item is saved
and restored when the key cache emits a changed signal. Restoring the
current item triggers the currentChanged signal.

The workaround skips the reimplementation of currentChanged in QListView
(which only sends the accessible focus event) by calling currentChanged
of QListView's parent class.

This fixes the problem that after opening the Edit Group dialog orca
thought that the current group in the Groups Configuration dialog
received the focus even though the Edit Group dialog has the input focus.

GnuPG-bug-id: 6095
parent 67adc49f
Pipeline #208829 passed with stage
in 5 minutes and 10 seconds
......@@ -47,6 +47,18 @@ public:
using QListView::QListView;
protected:
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
{
// workaround bug in QListView::currentChanged which sends an accessible focus event
// even if the list view doesn't have focus
if (hasFocus()) {
QListView::currentChanged(current, previous);
} else {
// skip the reimplementation of currentChanged in QListView
QAbstractItemView::currentChanged(current, previous);
}
}
void focusInEvent(QFocusEvent *event) override
{
QListView::focusInEvent(event);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment