35 , m_isNameFilterEnabled(false)
116 switch (sortColumn())
121 const QString strL = left.data().toString();
122 const QString strR = right.data().toString();
127 return base::lessThan(left, right);
133 const QAbstractItemModel *
const sourceModel = this->sourceModel();
137 const QString name = sourceModel->data(sourceModel->index(sourceRow,
NAME, sourceParent),
UnderlyingDataRole).toString();
140 if (!name.contains(word, Qt::CaseInsensitive))
147 const qlonglong size = sourceModel->data(sourceModel->index(sourceRow,
SIZE, sourceParent),
UnderlyingDataRole).toLongLong();
155 const int seeds = sourceModel->data(sourceModel->index(sourceRow,
SEEDS, sourceParent),
UnderlyingDataRole).toInt();
169 return base::filterAcceptsRow(sourceRow, sourceParent);
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
QString searchTerm() const
Utils::Compare::NaturalLessThan< Qt::CaseInsensitive > m_naturalLessThan
void setLeechesFilter(int minLeeches, int maxLeeches)
Sets parameters for filtering by leeches number.
QSortFilterProxyModel base
SearchSortModel(QObject *parent=nullptr)
void setNameFilter(const QString &searchTerm={})
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
void enableNameFilter(bool enabled)
void setSeedsFilter(int minSeeds, int maxSeeds)
Sets parameters for filtering by seeds number.
void setSizeFilter(qint64 minSize, qint64 maxSize)
Sets parameters for filtering by size.
bool m_isNameFilterEnabled
bool isNameFilterEnabled() const
QStringList m_searchTermWords
constexpr std::add_const_t< T > & asConst(T &t) noexcept