We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d521d3c commit 37a8496Copy full SHA for 37a8496
1 file changed
src/publisher_select_dialog.cpp
@@ -0,0 +1,29 @@
1
+#include "publisher_select_dialog.h"
2
+#include <QStringList>
3
+
4
+void PublisherSelectDialog::on_lineEditFilter_textChanged(const QString &search_string)
5
+{
6
+ QStringList spaced_items = search_string.split(' ');
7
8
+ for (const auto &pair : _topic_widgets)
9
+ {
10
+ const std::string &topic_name = pair.first;
11
+ QLabel *label = pair.second.first;
12
+ QCheckBox *checkbox = pair.second.second;
13
14
+ QString name = QString::fromStdString(topic_name);
15
+ bool toHide = false;
16
17
+ for (const auto &item : spaced_items)
18
19
+ if (!name.contains(item, Qt::CaseInsensitive))
20
21
+ toHide = true;
22
+ break;
23
+ }
24
25
26
+ label->setVisible(!toHide);
27
+ checkbox->setVisible(!toHide);
28
29
+}
0 commit comments