-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCvorPromet.h
36 lines (26 loc) · 953 Bytes
/
CvorPromet.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
#pragma once
#include <QAbstractTableModel>
#include <QDebug>
#include <string>
#include <Okvir.h>
class CvorPromet {
public:
QString MAC;
int BrojPaketa = 0;
};
class CvorPrometModel : public QAbstractTableModel
{
Q_OBJECT
public:
CvorPrometModel(QObject *parent = NULL);
void populateData(QList<CvorPromet> cvorovi);
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
bool dodajPromet(Okvir okvir, const QModelIndex &parent = QModelIndex());
void sortByColumn(int column, Qt::SortOrder order);
private:
QList<CvorPromet> promet;
};
Q_DECLARE_METATYPE(std::vector<CvorPromet>);