File indexing completed on 2024-04-14 03:47:40
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org> 0004 // SPDX-FileCopyrightText: 2012 Thibaut Gridel <tgridel@free.fr> 0005 0006 #ifndef BRANCHFILTERPROXYMODEL_H 0007 #define BRANCHFILTERPROXYMODEL_H 0008 0009 #include <QSortFilterProxyModel> 0010 0011 namespace Marble 0012 { 0013 0014 class GeoDataTreeModel; 0015 0016 class BranchFilterProxyModel : public QSortFilterProxyModel 0017 { 0018 public: 0019 explicit BranchFilterProxyModel( QObject *parent = nullptr ); 0020 0021 void setBranchIndex( GeoDataTreeModel *sourceModel, const QModelIndex &index ); 0022 0023 protected: 0024 bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const override; 0025 0026 private: 0027 GeoDataTreeModel *m_treeModel; 0028 QPersistentModelIndex m_branchIndex; 0029 0030 }; 0031 0032 } 0033 0034 #endif // BRANCHFILTERPROXYMODEL_H