GroupTableWidget.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef GROUPTABLEWIDGET_H
  2. #define GROUPTABLEWIDGET_H
  3. #include <qstandarditemmodel.h>
  4. #include <qstring.h>
  5. #include <qtableview.h>
  6. #include <qwidget.h>
  7. #include "dbService/ClassSet.h"
  8. struct AnalysisDataSource
  9. {
  10. QString node; //节点
  11. QString abscissa; //横坐标
  12. QString ordinate; //纵坐标
  13. QString nodeValue; //节点值
  14. int row = -1;
  15. int col = -1;
  16. bool changed = false;
  17. };
  18. class GroupTableWidget : public QTableView
  19. {
  20. Q_OBJECT
  21. public:
  22. enum IndexType
  23. {
  24. IndexTech = 1, //技术措施指标体系
  25. TechMessaure, //技术措施
  26. SchemaEval //方案评估指标体系
  27. };
  28. explicit GroupTableWidget(QWidget *parent = nullptr);
  29. ~GroupTableWidget();
  30. void addRowNode(QString node, QString name, QString remark);
  31. void addColNode(QString node, QString name, QString remark);
  32. QList<AnalysisDataSource> getSource() const;
  33. void paintDemandTable(QList<QList<DemandWeight *>> nodeValueInfoList, QString arithmeticMethod);
  34. void paintTechnicalTable(QList<QList<TechnicalImport *>> nodeValueInfoList, QString arithmeticMethod);
  35. void setTableType(int type);
  36. signals:
  37. void dataReady(bool status);
  38. void returnModel(QStandardItemModel *item);
  39. private slots:
  40. private:
  41. struct MatrixNode
  42. {
  43. MatrixNode(QString no, QString na, QString re)
  44. {
  45. node = no;
  46. name = na;
  47. remark = re;
  48. }
  49. QString node;
  50. QString name;
  51. QString remark;
  52. };
  53. bool paintDone = false;
  54. QList<MatrixNode> matrixRows;
  55. QList<MatrixNode> matrixCols;
  56. QList<AnalysisDataSource> dataSource;
  57. QStandardItemModel *model;
  58. QVector<qreal> importanceWidget;
  59. int tableType;
  60. };
  61. #endif // GROUPTABLEWIDGET_H