Traing mode changed from parallel port to usb solution
This commit is contained in:
35
timemodel.h
Normal file
35
timemodel.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef TIMEMODEL_H
|
||||
#define TIMEMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <qcolor.h>
|
||||
#include <qvector.h>
|
||||
|
||||
class TimeModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TimeModel(QVector<QVector<int>> timeData, QObject *parent = nullptr);
|
||||
|
||||
// Header:
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
|
||||
// Basic functionality:
|
||||
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;
|
||||
|
||||
// Add data:
|
||||
bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
||||
bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
|
||||
|
||||
private:
|
||||
int getMin(const QVector<int> x) const;
|
||||
|
||||
QColor getColor(const QVector<QVector<int>> data, const int col, const int row) const; // row and col starts counting at 0
|
||||
QVector<QVector<int>> timeData;
|
||||
};
|
||||
|
||||
#endif // TIMEMODEL_H
|
||||
Reference in New Issue
Block a user