GreyClusteringSampleTable.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef GREYCLUSTERINGSAMPLETABLE_H
  2. #define GREYCLUSTERINGSAMPLETABLE_H
  3. #include <QStandardItemModel>
  4. #include <QTableView>
  5. #include <QVector>
  6. #include <QSharedPointer>
  7. struct GreyRange
  8. {
  9. QString name;
  10. bool leftClose; // 左闭合
  11. double leftValue;
  12. bool rightClose; // 右闭合
  13. double rightValue;
  14. };
  15. struct GreyClusteringValue
  16. {
  17. QString units; // 单位
  18. double weiget;
  19. QVector<GreyRange> greyRanges; // 灰类
  20. double leftExtension; // 延拓值左
  21. double rightExtension; // 延拓值右
  22. double oldValue; // 实现值改前
  23. double newValue; // 实现值改后
  24. };
  25. struct GreyClusteringItem
  26. {
  27. QString indexName; // 指标名字
  28. int row;
  29. int col;
  30. int rowSpan;
  31. int colSpan;
  32. QSharedPointer<GreyClusteringValue> value;
  33. };
  34. class GreyClusteringSampleTable : public QTableView
  35. {
  36. Q_OBJECT
  37. public:
  38. GreyClusteringSampleTable(const QVector<GreyClusteringItem> &gcItems, int nodeDepth, int rowNodes,
  39. QWidget *parent = nullptr);
  40. void refreshTableView();
  41. private:
  42. void init();
  43. private:
  44. QVector<GreyClusteringItem> m_greyClusterings;
  45. QStandardItemModel *m_model;
  46. int m_nodeDepth; // 节点深度
  47. int m_rowNodes; //
  48. };
  49. #endif // GREYCLUSTERINGSAMPLETABLE_H