| 17 | } |
| 18 | |
| 19 | bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const |
| 20 | { |
| 21 | const auto &filters = m_parent->filters(); |
| 22 | for (auto it = filters.begin(); it != filters.end(); ++it) |
| 23 | { |
| 24 | auto idx = sourceModel()->index(source_row, 0, source_parent); |
| 25 | auto data = sourceModel()->data(idx, it.key()); |
| 26 | auto match = data.toString(); |
| 27 | if(!it.value()->accepts(match)) |
| 28 | { |
| 29 | return false; |
| 30 | } |
| 31 | } |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | void filterChanged() |
| 36 | { |