File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1818#include < QIcon>
1919#include < QMenu>
2020#include < QMessageBox>
21+ #include < QRegularExpression>
2122#include < QSortFilterProxyModel>
2223
2324class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
@@ -46,12 +47,9 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel
4647
4748 auto address = model->index (row, AddressTableModel::Address, parent);
4849
49- if (filterRegExp ().indexIn (model->data (address).toString ()) < 0 &&
50- filterRegExp ().indexIn (model->data (label).toString ()) < 0 ) {
51- return false ;
52- }
53-
54- return true ;
50+ auto match_address = filterRegularExpression ().match (model->data (address).toString ());
51+ auto match_label = filterRegularExpression ().match (model->data (label).toString ());
52+ return match_address.hasMatch () || match_label.hasMatch ();
5553 }
5654};
5755
You can’t perform that action at this time.
0 commit comments