Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
39564c0f
Commit
39564c0f
authored
Aug 12, 2022
by
Ingo Klöcker
Browse files
Announce current item when user ID list gets focus
GnuPG-bug-id: 6046
parent
06184481
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/certifywidget.cpp
View file @
39564c0f
...
...
@@ -280,6 +280,32 @@ QString formatDate(const QDate &date, QLocale::FormatType format)
return
QLocale
{}.
toString
(
date
,
dateFormatWithFourDigitYear
(
format
));
}
class
ListView
:
public
QListView
{
Q_OBJECT
public:
using
QListView
::
QListView
;
protected:
void
focusInEvent
(
QFocusEvent
*
event
)
override
{
QListView
::
focusInEvent
(
event
);
// queue the invokation, so that it happens after the widget itself got focus
QMetaObject
::
invokeMethod
(
this
,
&
ListView
::
forceAccessibleFocusEventForCurrentItem
,
Qt
::
QueuedConnection
);
}
private:
void
forceAccessibleFocusEventForCurrentItem
()
{
// force Qt to send a focus event for the current item to accessibility
// tools; otherwise, the user has no idea which item is selected when the
// list gets keyboard input focus
const
auto
current
=
currentIndex
();
setCurrentIndex
({});
setCurrentIndex
(
current
);
}
};
}
class
CertifyWidget
::
Private
...
...
@@ -323,7 +349,7 @@ public:
mainLay
->
addWidget
(
new
KSeparator
{
Qt
::
Horizontal
,
q
});
auto
listView
=
new
Q
ListView
{
q
};
auto
listView
=
new
ListView
{
q
};
listView
->
setModel
(
&
mUserIDModel
);
mainLay
->
addWidget
(
listView
,
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment