QtHPConnect/hptreeitem.h

68 lines
1.4 KiB
C
Raw Normal View History

2019-02-10 15:32:15 +02:00
#ifndef HPTREEITEM_H
#define HPTREEITEM_H
2019-02-10 15:43:00 +02:00
#include <QStandardItem>
2019-02-11 22:54:51 +02:00
#include <QMenu>
#include <QAction>
2019-02-10 15:43:00 +02:00
#include <QString>
#include "hpdata.h"
#include "mainwindow.h"
2019-02-10 15:32:15 +02:00
2019-02-10 15:43:00 +02:00
class hp_mdiVariableEdit;
class hp_mdiTextEdit;
2019-02-25 09:36:58 +02:00
//enum hp_DataType;
2019-02-10 15:43:00 +02:00
2019-02-11 22:54:51 +02:00
enum contextActionType {
CT_PREFERENCE
};
2019-02-10 15:43:00 +02:00
class hpTreeItem: public QObject, public QStandardItem
2019-02-10 15:32:15 +02:00
{
2019-02-10 15:43:00 +02:00
Q_OBJECT
2019-02-10 15:32:15 +02:00
public:
2019-02-10 15:43:00 +02:00
hpTreeItem();
hpTreeItem(const QString &,hpCalcData *, int);
virtual QStandardItem *clone() const;
void setGraphicTree();
2019-02-25 09:36:58 +02:00
void setType(hp_DataType);
2019-02-10 15:43:00 +02:00
void clickAction(QMdiArea * mwin);
2019-02-11 22:54:51 +02:00
void contextAction(QMdiArea * mdiwin, contextActionType cta );
2019-02-10 15:43:00 +02:00
void setDataStore(hpCalcData *);
hpCalcData * getDataStore();
2019-02-25 20:28:45 +02:00
QString getGroupName();
QString getFileName();
2019-03-09 22:11:43 +02:00
void setFileName(QString);
2019-02-25 09:36:58 +02:00
hp_DataType getType();
void refresh();
2019-02-25 20:28:45 +02:00
int findFile(QString);
void addFile(AbstractData *);
2019-02-25 09:36:58 +02:00
void addChild(AbstractData * obj);
2019-09-15 17:23:44 +02:00
virtual ~hpTreeItem();
2019-04-02 21:14:31 +02:00
2019-02-10 15:43:00 +02:00
public slots:
void dataChange(hp_Change hpchange);
private:
const static QString func_list[][2];
2019-02-25 09:36:58 +02:00
const static hp_DataType func_type[];
2019-02-25 20:28:45 +02:00
QString filename;
2019-02-25 09:36:58 +02:00
hp_DataType type;
2019-02-10 15:43:00 +02:00
hpCalcData * hp_data=nullptr;
QMdiArea * mdiarea=nullptr;
hp_mdiVariableEdit * hpvaredit = nullptr;
hp_mdiTextEdit * hptextedit = nullptr;
int dt2int();
2019-02-17 18:24:52 +02:00
signals:
void dataChanged(hp_Change datachange);
2019-02-10 15:32:15 +02:00
};
2019-02-10 15:43:00 +02:00
Q_DECLARE_METATYPE(hpTreeItem *)
#endif // HPTREEITEM_H