30 #include <QStringList> 39 : QSortFilterProxyModel (parent)
48 Separator_ = separator;
50 if (dynamicSortFilter ())
58 if (dynamicSortFilter ())
66 if (dynamicSortFilter ())
84 if (index.isValid () && sourceModel ()->rowCount (index))
87 const auto& pattern = filterRegExp ().pattern ();
88 if (pattern.isEmpty ())
91 for (
int i = 0, cc = sourceModel ()->columnCount (index); i < cc; ++i)
93 const auto& rowIdx = sourceModel ()->index (source_row, i, index);
94 const auto& str = rowIdx.data ().toString ();
95 if (str.contains (pattern) || filterRegExp ().exactMatch (str))
103 QStringList filterTags;
104 const auto& pattern = filterRegExp ().pattern ();
105 for (
const auto& s : pattern.split (Separator_, QString::SkipEmptyParts))
106 filterTags << s.trimmed ();
108 if (!filterTags.size ())
112 for (
int i = 0; i < filterTags.size (); ++i)
115 for (
int j = 0; j < itemTags.size (); ++j)
116 if (itemTags.at (j).contains (filterTags.at (i)))