2 // filelistmodel.h: Class definition
5 // (C) 2010 Underground Software
8 #ifndef __FILELISTMODEL_H__
9 #define __FILELISTMODEL_H__
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) {}
19 unsigned long dbIndex;
20 unsigned long fileSize;
26 #define FLM_INDEX (Qt::UserRole + 1)
27 #define FLM_FILESIZE (Qt::UserRole + 2)
28 #define FLM_FILENAME (Qt::UserRole + 3)
29 #define FLM_LABEL (Qt::UserRole + 4)
31 class FileListModel: public QAbstractListModel
34 FileListModel(QObject * parent = 0);
36 int rowCount(const QModelIndex & parent = QModelIndex()) const;
37 QVariant data(const QModelIndex & index, int role) const;
38 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
40 // void AddData(QIcon pix);
41 // void AddData(unsigned long);
42 void AddData(unsigned long, QString, QImage, unsigned long);
44 // FileListData GetData(const QModelIndex & index) const;
47 // std::vector<QIcon> pixList;
48 // std::vector<unsigned long> dbIndex;
49 std::vector<FileListData> list;
50 // std::vector<unsigned long> size;
53 #endif // __FILELISTMODEL_H__