QTfrontend/themesmodel.h
author nemo
Mon, 12 Sep 2011 19:30:18 -0400
changeset 5883 a6d764786905
parent 5289 9d18b61bd3eb
permissions -rw-r--r--
Disable GL SetAttributes for Windows due to many testers with problems. This restores .15 behaviour. If we can find willing testers, perhaps we can narrow down which attribute was the problem. Also reenable F12 bind for Windows.
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