]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/filelistmodel.h
Successfully integrated ZIP file fishing of images & software
[virtualjaguar] / src / gui / filelistmodel.h
1 //
2 // filelistmodel.h: Class definition
3 //
4 // by James L. Hammons
5 // (C) 2010 Underground Software
6 //
7
8 #ifndef __FILELISTMODEL_H__
9 #define __FILELISTMODEL_H__
10
11 #include <QtGui>
12 #include <vector>
13
14 struct FileListData
15 {
16 //      FileListData(unsigned long ul=0, QString str="", QImage img=QImage()): dbIndex(ul), filename(str), label(img) {}
17 //      FileListData(unsigned long ul=0, QString str, QImage img): dbIndex(ul), filename(str), label(img) {}
18
19         unsigned long dbIndex;
20         QString filename;
21         QImage label;
22 };
23
24 class FileListModel: public QAbstractListModel
25 {
26         public:
27                 FileListModel(QObject * parent = 0);
28
29                 int rowCount(const QModelIndex & parent = QModelIndex()) const;
30                 QVariant data(const QModelIndex & index, int role) const;
31                 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
32
33                 void AddData(QIcon pix);
34                 void AddData(unsigned long);
35                 void AddData(unsigned long, QString, QImage);
36
37 //              FileListData GetData(const QModelIndex & index) const;
38
39         private:
40                 std::vector<QIcon> pixList;
41                 std::vector<unsigned long> dbIndex;
42                 std::vector<FileListData> list;
43 };
44
45 #endif  // __FILELISTMODEL_H__