File indexing completed on 2024-04-28 11:30:59
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2008 Claudiu Covaci <claudiu.covaci@gmail.com> 0004 // SPDX-FileCopyrightText: 2009 Torsten Rahn <tackat@kde.org> 0005 // 0006 0007 #ifndef MARBLE_MAPTHEMESORTFILTERPROXYMODEL_H 0008 #define MARBLE_MAPTHEMESORTFILTERPROXYMODEL_H 0009 0010 #include <QSortFilterProxyModel> 0011 0012 class QDateTime; 0013 0014 namespace Marble 0015 { 0016 0017 class MapThemeSortFilterProxyModel : public QSortFilterProxyModel 0018 { 0019 Q_OBJECT 0020 0021 public: 0022 explicit MapThemeSortFilterProxyModel(QObject *parent = nullptr); 0023 0024 protected: 0025 bool lessThan( const QModelIndex &left, const QModelIndex &right ) const override; 0026 bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const override; 0027 0028 private: 0029 static bool isFavorite( const QModelIndex& index ); 0030 static QDateTime favoriteDateTime( const QModelIndex& index ); 0031 }; 0032 0033 } 0034 0035 #endif