MatrixTableTechMeasuresWidget.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef MATRIXTABLETECHMEASURESWIDGET_H
  2. #define MATRIXTABLETECHMEASURESWIDGET_H
  3. #include <QStandardItemModel>
  4. #include <QTableView>
  5. #include <SpinBoxDelegate.h>
  6. #include "MatrixTableWidget.h"
  7. class MatrixTableTechMeasuresWidget : public QTableView
  8. {
  9. Q_OBJECT
  10. public:
  11. explicit MatrixTableTechMeasuresWidget(QWidget *parent = nullptr);
  12. ~MatrixTableTechMeasuresWidget();
  13. void addRowNode(QString node, QString name, QString remark);
  14. void addColNode(QString node, QString name, QString remark);
  15. QList<MatrixDataSource> getSource() const;
  16. bool isDataReady() const;
  17. void paintMatrixTable(QList<NodeMatrixInfo *> nodeValueInfoList);
  18. void setTableName(QString name);
  19. signals:
  20. void dataReady(bool status);
  21. void returnModel(QStandardItemModel *item);
  22. void returnModelName(QString name);
  23. private slots:
  24. void itemClicked(const QModelIndex &index);
  25. private:
  26. void editItemData(const QModelIndex &index, const QString &val);
  27. struct MatrixNode
  28. {
  29. MatrixNode(QString no, QString na, QString re) : node(no), name(na), remark(re) { }
  30. QString node;
  31. QString name;
  32. QString remark;
  33. };
  34. bool paintDone = false;
  35. QList<MatrixNode> matrixRows;
  36. QList<MatrixNode> matrixCols;
  37. QList<MatrixDataSource> dataSource;
  38. QStandardItemModel *model;
  39. bool diagonalIsOne;
  40. SpinBoxDelegate *delegate;
  41. QString m_msg_name;
  42. };
  43. #endif // MATRIXTABLETECHMEASURESWIDGET_H