QTfrontend/model/ThemeModel.h
changeset 11753 5c192a4751d8
parent 11046 47a8c19ecb60
child 11754 2e4f0d0fec99
equal deleted inserted replaced
11752:3c66845947a8 11753:5c192a4751d8
    23 
    23 
    24 #ifndef HEDGEWARS_THEMEMODEL_H
    24 #ifndef HEDGEWARS_THEMEMODEL_H
    25 #define HEDGEWARS_THEMEMODEL_H
    25 #define HEDGEWARS_THEMEMODEL_H
    26 
    26 
    27 #include <QAbstractListModel>
    27 #include <QAbstractListModel>
       
    28 #include <QSortFilterProxyModel>
    28 #include <QStringList>
    29 #include <QStringList>
    29 #include <QMap>
    30 #include <QMap>
    30 #include <QIcon>
    31 #include <QIcon>
    31 
    32 
    32 #include "DataManager.h"
    33 #include "DataManager.h"
    42         enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole };
    43         enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole };
    43         explicit ThemeModel(QObject *parent = 0);
    44         explicit ThemeModel(QObject *parent = 0);
    44 
    45 
    45         int rowCount(const QModelIndex &parent = QModelIndex()) const;
    46         int rowCount(const QModelIndex &parent = QModelIndex()) const;
    46         QVariant data(const QModelIndex &index, int role) const;
    47         QVariant data(const QModelIndex &index, int role) const;
       
    48         QSortFilterProxyModel * withoutDLC();
    47 
    49 
    48     private:
    50     private:
    49         mutable QList<QMap<int, QVariant> > m_data;
    51         mutable QList<QMap<int, QVariant> > m_data;
    50         mutable bool m_themesLoaded;
    52         mutable bool m_themesLoaded;
       
    53         mutable QSortFilterProxyModel * m_filteredNoDLC;
    51 
    54 
    52         void loadThemes() const;
    55         void loadThemes() const;
    53 };
    56 };
    54 
    57 
    55 #endif // HEDGEWARS_THEMEMODEL_H
    58 #endif // HEDGEWARS_THEMEMODEL_H