2 // filelistmodel.h: Class definition
5 // (C) 2010 Underground Software
8 #ifndef __FILELISTMODEL_H__
9 #define __FILELISTMODEL_H__
17 // FileListData(unsigned long ul=0, QString str="", QImage img=QImage()): dbIndex(ul), filename(str), label(img) {}
18 // FileListData(unsigned long ul=0, QString str, QImage img): dbIndex(ul), filename(str), label(img) {}
20 unsigned long dbIndex
;
21 unsigned long fileSize
;
24 bool hasUniversalHeader
;
30 #define FLM_INDEX (Qt::UserRole + 1)
31 #define FLM_FILESIZE (Qt::UserRole + 2)
32 #define FLM_FILENAME (Qt::UserRole + 3)
33 #define FLM_LABEL (Qt::UserRole + 4)
34 #define FLM_UNIVERSALHDR (Qt::UserRole + 5)
35 #define FLM_FILETYPE (Qt::UserRole + 6)
36 #define FLM_CRC (Qt::UserRole + 7)
38 class FileListModel
: public QAbstractListModel
41 FileListModel(QObject
* parent
= 0);
43 int rowCount(const QModelIndex
& parent
= QModelIndex()) const;
44 QVariant
data(const QModelIndex
& index
, int role
) const;
45 QVariant
headerData(int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
47 // void AddData(QIcon pix);
48 // void AddData(unsigned long);
49 void AddData(unsigned long, QString
, QImage
, unsigned long);
50 void AddData(unsigned long, QString
, QImage
, unsigned long, bool, uint32_t, uint32_t);
53 // FileListData GetData(const QModelIndex & index) const;
56 std::vector
<FileListData
> list
;
59 #endif // __FILELISTMODEL_H__