QtHPConnect/treemodel.h

41 lines
743 B
C
Raw Normal View History

2019-02-10 14:32:15 +01:00
#ifndef TREEMODEL_H
#define TREEMODEL_H
2019-02-10 14:43:00 +01:00
#include <QStandardItemModel>
2019-02-10 14:32:15 +01:00
#include <QObject>
2019-02-10 14:43:00 +01:00
#include <QMap>
2019-02-10 14:32:15 +01:00
2019-02-10 14:43:00 +01:00
#include "hpdata.h"
class hpTreeItem;
struct hpDataLink {
hpTreeItem * treeItem;
hpCalcData * dataItem;
};
class treeModel: public QStandardItemModel
2019-02-10 14:32:15 +01:00
{
2019-02-10 14:43:00 +01:00
Q_OBJECT
private:
int createRoot();
QStandardItem *rootNode;
QMap<QString,hpDataLink> hpCalcList;
hpCalcData * hpdata;
2019-02-10 14:32:15 +01:00
public:
2019-02-10 14:43:00 +01:00
treeModel(QObject *parent);
~treeModel();
int addCalculator(QString name, hpusb * handle);
hpCalcData * getCalculator(QString name);
hpCalcData * getHpCalcData(QString name);
void setHpCalcData(QString name, hpCalcData * , hpTreeItem *);
QString getLastDataKey();
2019-02-10 14:32:15 +01:00
};
2019-02-10 14:43:00 +01:00
#endif // TREEMODEL_H