mirror of
https://github.com/Indy970/QtHPConnect
synced 2024-12-25 21:59:15 +01:00
40 lines
743 B
C++
40 lines
743 B
C++
#ifndef TREEMODEL_H
|
|
#define TREEMODEL_H
|
|
|
|
#include <QStandardItemModel>
|
|
#include <QObject>
|
|
#include <QMap>
|
|
|
|
#include "hpdata.h"
|
|
|
|
class hpTreeItem;
|
|
|
|
struct hpDataLink {
|
|
hpTreeItem * treeItem;
|
|
hpCalcData * dataItem;
|
|
};
|
|
|
|
class treeModel: public QStandardItemModel
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
private:
|
|
int createRoot();
|
|
QStandardItem *rootNode;
|
|
QMap<QString,hpDataLink> hpCalcList;
|
|
hpCalcData * hpdata;
|
|
|
|
public:
|
|
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();
|
|
|
|
};
|
|
|
|
#endif // TREEMODEL_H
|
|
|