72bool QQmlRegExpFilter::filterAcceptsRowInternal(
int row,
const QModelIndex &sourceParent,
73 const QQmlSortFilterProxyModel *proxyModel)
const
75 Q_D(
const QQmlRegExpFilter);
76 if (d->m_roleName.isEmpty() || !d->regExp.isValid())
79 const int role = itemRole(proxyModel);
81 if (!d->m_roleNameValidated) {
82 qWarning(
"Provided role name %s doesn't exist in the model",
83 d->m_roleName.toUtf8().constData());
84 d->m_roleNameValidated =
true;
89 auto filterData = [&](
const QModelIndex &index) ->
bool {
90 const QString value = proxyModel->sourceModel()->data(index, role).toString();
94 const QRegularExpressionMatch match =
95 d->regExp.match(value, 0, QRegularExpression::NormalMatch);
96 return match.hasMatch();
100 const QModelIndex index = proxyModel->sourceModel()->index(row, column(), sourceParent);
101 return filterData(index);
103 const int columnCount = proxyModel->sourceModel()->columnCount(sourceParent);
104 for (
int column = 0; column < columnCount; ++column) {
105 if (filterData(proxyModel->sourceModel()->index(row, column, sourceParent)))