|
|
|
|
@ -141,6 +141,45 @@ bool EntityCollectionOrderProxyModel::lessThan(const QModelIndex &left, const QM |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool EntityCollectionOrderProxyModel::filterAcceptsRow(int source_row, const QModelIndex &parent) const |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
QStringList words = filterRegExp().pattern().split(' ',QString::SkipEmptyParts); |
|
|
|
|
if (words.count()>1) { // helm style
|
|
|
|
|
bool accept = true; |
|
|
|
|
|
|
|
|
|
for (int i=0;(accept && i<words.count());i++) { |
|
|
|
|
EntityCollectionOrderProxyModel tmp; |
|
|
|
|
tmp.setSourceModel(sourceModel()); |
|
|
|
|
tmp.setFilterCaseSensitivity(Qt::CaseInsensitive); |
|
|
|
|
tmp.setFilterWildcard(words[i]); |
|
|
|
|
accept &= tmp.filterAcceptsRow(source_row,parent); |
|
|
|
|
} |
|
|
|
|
if (!accept) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
accept = false; |
|
|
|
|
for (int i=0;(!accept && i<words.count());i++) { |
|
|
|
|
EntityCollectionOrderProxyModel tmp; |
|
|
|
|
tmp.setSourceModel(sourceModel()); |
|
|
|
|
tmp.setFilterCaseSensitivity(Qt::CaseInsensitive); |
|
|
|
|
tmp.setFilterWildcard(words[i]); |
|
|
|
|
accept |= tmp.QSortFilterProxyModel::filterAcceptsRow(source_row,parent); |
|
|
|
|
} |
|
|
|
|
return accept; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (QSortFilterProxyModel::filterAcceptsRow(source_row, parent)) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
// walk up the hierarchy
|
|
|
|
|
if (parent.isValid()) { |
|
|
|
|
return filterAcceptsRow(parent.row(),parent.parent()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void EntityCollectionOrderProxyModel::setManualSortingActive(bool active) |
|
|
|
|
{ |
|
|
|
|
if (d->manualSortingActive == active) { |
|
|
|
|
|