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
Utilities
Kate
Commits
3c2bbb9c
Commit
3c2bbb9c
authored
Oct 26, 2022
by
Waqar Ahmed
Browse files
Config search: Also search in QComboBoxes
As a drive by, use QAbstractButton instead of specifying each child class
parent
b742feb7
Pipeline
#255798
canceled with stage
in 9 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/lib/kateconfigdialog.cpp
View file @
3c2bbb9c
...
...
@@ -144,6 +144,19 @@ QVector<QWidget *> hasMatchingText(const QString &text, QWidget *page)
return
ret
;
}
template
<
>
QVector
<
QWidget
*>
hasMatchingText
<
QComboBox
>
(
const
QString
&
text
,
QWidget
*
page
)
{
QVector
<
QWidget
*>
ret
;
const
auto
comboxBoxes
=
page
->
findChildren
<
QComboBox
*>
();
for
(
auto
cb
:
comboxBoxes
)
{
if
(
cb
->
findText
(
text
,
Qt
::
MatchFlag
::
MatchContains
)
!=
-
1
)
{
ret
<<
cb
;
}
}
return
ret
;
}
template
<
typename
...
>
struct
FindChildrenHelper
{
static
QVector
<
QWidget
*>
hasMatchingTextForTypes
(
const
QString
&
,
QWidget
*
)
...
...
@@ -236,7 +249,7 @@ void KateConfigDialog::onSearchTextChanged()
QVector
<
QWidget
*>
matchedWidgets
;
if
(
!
text
.
isEmpty
())
{
for
(
auto
item
:
std
::
as_const
(
m_allPages
))
{
const
auto
matchingWidgets
=
FindChildrenHelper
<
QLabel
,
Q
Push
Button
,
QC
heckBox
,
QRadioButton
>::
hasMatchingTextForTypes
(
text
,
item
->
widget
());
const
auto
matchingWidgets
=
FindChildrenHelper
<
QLabel
,
Q
Abstract
Button
,
QC
omboBox
>::
hasMatchingTextForTypes
(
text
,
item
->
widget
());
if
(
matchingWidgets
.
isEmpty
())
{
pagesToHide
<<
item
->
name
();
}
...
...
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