File indexing completed on 2024-05-19 05:44:26

0001 /*
0002     SPDX-FileCopyrightText: 2015-2017 Milian Wolff <mail@milianw.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef TREEPROXY_H
0008 #define TREEPROXY_H
0009 
0010 #include <QSortFilterProxyModel>
0011 
0012 class TreeProxy final : public QSortFilterProxyModel
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit TreeProxy(int symbolRole, int resultDataRole, QObject* parent = nullptr);
0017     virtual ~TreeProxy();
0018 
0019 public slots:
0020     void setFunctionFilter(const QString& functionFilter);
0021     void setModuleFilter(const QString& moduleFilter);
0022 
0023 private:
0024     bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
0025     bool lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const override;
0026 
0027     const int m_symbolRole;
0028     const int m_resultDataRole;
0029 
0030     QString m_functionFilter;
0031     QString m_moduleFilter;
0032 };
0033 
0034 #endif // TREEPROXY_H