39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#ifndef ALARMCALCPARATABLEMODEL_H
|
|
#define ALARMCALCPARATABLEMODEL_H
|
|
|
|
#include <QAbstractTableModel>
|
|
#include "AlarmCalcInfo.h"
|
|
#include <QTableView>
|
|
|
|
class AlarmCalcParaTableModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AlarmCalcParaTableModel(QObject *parent = nullptr,QTableView *view = Q_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;
|
|
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
|
|
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
|
|
|
|
AlarmCalcInfoPtr getCalcParaInfo(const QModelIndex &index);
|
|
public slots:
|
|
void slotChangePara(QList<AlarmCalcInfoPtr> paraList);
|
|
|
|
void slotClearPara();
|
|
private:
|
|
QTableView *m_view;
|
|
QStringList m_header;
|
|
QList<AlarmCalcInfoPtr> m_list;
|
|
};
|
|
|
|
#endif // ALARMCALCPARATABLEMODEL_H
|