-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathHeaderObjectsModel.h
More file actions
76 lines (64 loc) · 1.91 KB
/
HeaderObjectsModel.h
File metadata and controls
76 lines (64 loc) · 1.91 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// Created by user on 14.06.2021.
//
#ifndef FOCUSIPC_HEADEROBJECTSMODEL_H
#define FOCUSIPC_HEADEROBJECTSMODEL_H
#include <QAbstractTableModel>
#include <ImageSection.h>
class HeaderObjectsModel : public QAbstractTableModel {
Q_OBJECT
enum enColumnsNames {
width,
height,
X,
Y,
type,
z,
intensity,
R,
G,
B,
A,
COL_MAX
};
[[nodiscard]] static inline const char *colNamesToString(enColumnsNames n) {
switch (n) {
case width :
return "Width";
case height :
return "Height";
case X :
return "X";
case Y :
return "Y";
case type :
return "Type";
case z :
return "Z index";
case intensity :
return "Intensity";
case R :
return "R";
case G :
return "G";
case B :
return "B";
case A :
return "Palette";
default:
return "";
}
}
public:
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
void importLines(const vector <ImageSection::HeaderRecord> &data);
[[nodiscard]] const vector <ImageSection::HeaderRecord> & exportLines() const;
private:
vector <ImageSection::HeaderRecord> m_lines{};
};
#endif //FOCUSIPC_HEADEROBJECTSMODEL_H