-
Notifications
You must be signed in to change notification settings - Fork 0
/
VictimsTableModel.h
39 lines (26 loc) · 1016 Bytes
/
VictimsTableModel.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
#pragma once
#include <qabstractitemmodel.h>
#include "FileRepo.h"
#include "VirtualRepo.h"
#include "Service.h"
class VictimsTableModel :
public QAbstractTableModel
{
private:
std::vector<Victim> victimsSaved;
public:
VictimsTableModel(std::vector<Victim> victimsSaved, QObject* parent = NULL);
~VictimsTableModel() {};
//number of rows
int rowCount(const QModelIndex& parent = QModelIndex{}) const override;
//number of columns
int columnCount(const QModelIndex& parent = QModelIndex{}) const override;
//Value at a given position
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
//add header data
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
//will be called wehn a cell is edited
//bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
//used to set certain properties of a cell
Qt::ItemFlags flags(const QModelIndex& index) const override;
};