QTfrontend/themesmodel.h
author nemo
Sun, 11 Sep 2011 21:30:42 -0400
changeset 5871 09daa06191d7
parent 5289 9d18b61bd3eb
permissions -rw-r--r--
Since we are tweaking molotov. make the flame flickery and add a drowning frame
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5289
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     1
#ifndef THEMESMODEL_H
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     2
#define THEMESMODEL_H
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     3
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     4
#include <QAbstractListModel>
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     5
#include <QStringList>
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     6
#include <QHash>
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     7
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     8
class ThemesModel : public QAbstractListModel
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
     9
{
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    10
    Q_OBJECT
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    11
public:
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    12
    explicit ThemesModel(QStringList themes, QObject *parent = 0);
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    13
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    14
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    15
    QVariant data(const QModelIndex &index, int role) const;
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    16
    bool setData(const QModelIndex &index, const QVariant &value,
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    17
                 int role = Qt::EditRole);
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    18
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    19
signals:
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    20
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    21
public slots:
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    22
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    23
private:
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    24
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    25
    QList<QHash<int, QVariant> > m_data;
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    26
};
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    27
9d18b61bd3eb - Implement ThemesModel (load theme icons once, store in memory, don't reload from disk every time selection changes)
unc0rr
parents:
diff changeset
    28
#endif // THEMESMODEL_H