-
Notifications
You must be signed in to change notification settings - Fork 5
/
vbfmodel.h
50 lines (39 loc) · 1.02 KB
/
vbfmodel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef VBFMODEL_H
#define VBFMODEL_H
#include <QAbstractListModel>
#include "vbffile.h"
class VbfModel : public QAbstractListModel
{
Q_OBJECT
private:
block_t empty;
vbf_t vbf;
signals:
void sig_resize();
public:
VbfModel(QObject *parent = 0);
enum enum_can
{
e_col_block = 0,
e_col_size,
e_col_rm,
e_col_nums
};
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
public:
void reset();
int size();
void set(const vbf_t & vbf);
const vbf_t & get();
bool add(const QString & fileName);
bool insert(int idx, const QString & fileName);
void rm(int idx);
const block_t & get_block(int idx);
void update_block(int idx, uint32_t addr);
void update_block(int idx, const QByteArray & data);
void update_header(struct header_t & header);
};
#endif