-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathgcodetablemodel.h
46 lines (35 loc) · 1.16 KB
/
gcodetablemodel.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
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich
#ifndef GCODETABLEMODEL_H
#define GCODETABLEMODEL_H
#include <QAbstractTableModel>
#include <QString>
struct GCodeItem
{
QString command;
QString state;
QString status;
int line;
QList<QString> args;
};
class GCodeTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit GCodeTableModel(QObject *parent = 0);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
bool insertRow(int row, const QModelIndex &parent = QModelIndex());
bool removeRow(int row, const QModelIndex &parent = QModelIndex());
void clear();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
signals:
public slots:
private:
QList<GCodeItem*> m_data;
QList<QString> m_headers;
};
#endif // GCODETABLEMODEL_H