File indexing completed on 2024-11-24 04:16:55

0001 /*
0002   SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "libbergamot_private_export.h"
0009 #include <QSortFilterProxyModel>
0010 
0011 class LIBBERGAMOT_TESTS_EXPORT TranslatorProxyModel : public QSortFilterProxyModel
0012 {
0013     Q_OBJECT
0014 public:
0015     explicit TranslatorProxyModel(QObject *parent = nullptr);
0016     ~TranslatorProxyModel() override;
0017 
0018     [[nodiscard]] QString searchString() const;
0019     void setSearchString(const QString &newSearchString);
0020 
0021 protected:
0022     [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
0023 
0024 private:
0025     QString mSearchString;
0026 };