12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef GROUPTABLEWIDGET_H
- #define GROUPTABLEWIDGET_H
- #include <qstandarditemmodel.h>
- #include <qstring.h>
- #include <qtableview.h>
- #include <qwidget.h>
- #include "dbService/ClassSet.h"
- struct AnalysisDataSource
- {
- QString node; //节点
- QString abscissa; //横坐标
- QString ordinate; //纵坐标
- QString nodeValue; //节点值
- int row = -1;
- int col = -1;
- bool changed = false;
- };
- class GroupTableWidget : public QTableView
- {
- Q_OBJECT
- public:
- enum IndexType
- {
- IndexTech = 1, //技术措施指标体系
- TechMessaure, //技术措施
- SchemaEval //方案评估指标体系
- };
- explicit GroupTableWidget(QWidget *parent = nullptr);
- ~GroupTableWidget();
- void addRowNode(QString node, QString name, QString remark);
- void addColNode(QString node, QString name, QString remark);
- QList<AnalysisDataSource> getSource() const;
- void paintDemandTable(QList<QList<DemandWeight *>> nodeValueInfoList, QString arithmeticMethod);
- void paintTechnicalTable(QList<QList<TechnicalImport *>> nodeValueInfoList, QString arithmeticMethod);
- void setTableType(int type);
- signals:
- void dataReady(bool status);
- void returnModel(QStandardItemModel *item);
- private slots:
- private:
- struct MatrixNode
- {
- MatrixNode(QString no, QString na, QString re)
- {
- node = no;
- name = na;
- remark = re;
- }
- QString node;
- QString name;
- QString remark;
- };
- bool paintDone = false;
- QList<MatrixNode> matrixRows;
- QList<MatrixNode> matrixCols;
- QList<AnalysisDataSource> dataSource;
- QStandardItemModel *model;
- QVector<qreal> importanceWidget;
- int tableType;
- };
- #endif // GROUPTABLEWIDGET_H
|