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
6ca6a3a2
Commit
6ca6a3a2
authored
Aug 03, 2022
by
Ingo Klöcker
Browse files
Announce current item when test results tree gets focus
GnuPG-bug-id: 6101
parent
f6743889
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/selftestdialog.cpp
View file @
6ca6a3a2
...
...
@@ -226,6 +226,32 @@ private:
bool
m_showAll
;
};
class
TreeView
:
public
NavigatableTreeView
{
Q_OBJECT
public:
using
NavigatableTreeView
::
NavigatableTreeView
;
protected:
void
focusInEvent
(
QFocusEvent
*
event
)
override
{
NavigatableTreeView
::
focusInEvent
(
event
);
// queue the invokation, so that it happens after the widget itself got focus
QMetaObject
::
invokeMethod
(
this
,
&
TreeView
::
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
SelfTestDialog
::
Private
...
...
@@ -313,7 +339,7 @@ private:
Proxy
proxy
;
struct
UI
{
Navigatable
TreeView
*
resultsTV
=
nullptr
;
TreeView
*
resultsTV
=
nullptr
;
QCheckBox
*
showAllCB
=
nullptr
;
QGroupBox
*
detailsGB
=
nullptr
;
QLabel
*
detailsLB
=
nullptr
;
...
...
@@ -348,7 +374,7 @@ private:
auto
vbox
=
new
QVBoxLayout
{
widget
};
vbox
->
setContentsMargins
(
0
,
0
,
0
,
0
);
resultsTV
=
new
Navigatable
TreeView
{
qq
};
resultsTV
=
new
TreeView
{
qq
};
resultsTV
->
setAccessibleName
(
i18n
(
"test results"
));
QSizePolicy
sizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
sizePolicy
.
setHorizontalStretch
(
0
);
...
...
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