File indexing completed on 2024-02-25 16:44:40

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "searchtreebasefilterproxymodel.h"
0008 SearchTreeBaseFilterProxyModel::SearchTreeBaseFilterProxyModel(QAbstractListModel *model, QObject *parent)
0009     : QSortFilterProxyModel(parent)
0010 {
0011     setSourceModel(model);
0012 
0013     setFilterCaseSensitivity(Qt::CaseInsensitive);
0014     sort(0, Qt::DescendingOrder);
0015 }
0016 
0017 SearchTreeBaseFilterProxyModel::~SearchTreeBaseFilterProxyModel() = default;
0018 
0019 void SearchTreeBaseFilterProxyModel::setFilterString(const QString &string)
0020 {
0021     setFilterFixedString(string);
0022 }
0023 
0024 void SearchTreeBaseFilterProxyModel::clearFilter()
0025 {
0026     setFilterFixedString(QString());
0027 }
0028 
0029 #include "moc_searchtreebasefilterproxymodel.cpp"