emsApplication/applications/emsConfigurer/mytablemodel.h

37 lines
1.1 KiB
C++

#ifndef MYTABLEMODEL_H
#define MYTABLEMODEL_H
#pragma execution_character_set("utf-8")
#include <QAbstractTableModel>
#include <QString>
#include "globalparameters.h"
class MyTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
MyTableModel(QObject* parent);
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;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
Qt::ItemFlags flags(const QModelIndex& index) const Q_DECL_OVERRIDE;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
const TableData *getModelData() const;
private:
TableData m_modelData;
QStringList m_headeList;
public:
void setHeadData(QStringList i_list);
void setModelData(TableData data);
void clearModelData();
};
#endif // MYTABLEMODEL_H