#ifndef DATATABLEWIDGET_H #define DATATABLEWIDGET_H #include #include "SchemePlanManager.h" #include #include #include class DataTableComboDelegate; class CMind; class ProjectInfo; class PushButton; class QLabel; class QTabWidget; class QVBoxLayout; class QHBoxLayout; class DataTableItemModel : public QStandardItemModel { public: explicit DataTableItemModel(QObject *parent = nullptr); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; }; /** * @brief The DataTableWidget class * 数据表, 整体上是包含多个 QTableView 的 QTabWidget * 显示以下数据: * 能力重要度评估, 技术措施重要度, 方案优选评估: 权重分析数据和评估数据 * 综合效能评估: 权重分析数据 * 综合效能评估-物元分析法: 评估数据 */ class DataTableWidget : public QWidget { Q_OBJECT public: explicit DataTableWidget(SchemePlanManager::SchemeProcessInfo process, QWidget *parent = nullptr); SchemePlanManager::SchemeProcessInfo process() const; void initWidget(); void initLayout(); void connectSignalsAndSlots(); void setupModels(); void setupTabWidget(); int currentPage() const; void setCurrentPage(int p); void updateCurrentTable(); void setSchemeList(const QList &list); void addScheme(SchemaEval *scheme); QTabWidget *tabWidget() const; CMind *mind1() const; CMind *mind2() const; void setNodeMatrixData(QList data, bool isExpertData); signals: void sigMeasureDataEdited(NodeMatrixInfo *info); private: void updateModel(DataTableItemModel *model, QList &hHeaders, QList &vHeaders, int hStart = 0, int vStart = 0); public slots: void slotPrevious(); void slotNext(); void slotTabCurrentChanged(int c); void itemChanged(QStandardItem *item); private: SchemePlanManager::SchemeProcessInfo m_process; QMap> m_models; int m_currentPage = 0; CMind *m_mind1 = nullptr; CMind *m_mind2 = nullptr; QTabWidget *m_dataTab = nullptr; QLabel *m_pageLab = nullptr; // 共4页, 当前第2页 PushButton *m_previous = nullptr; // 上一级指标 PushButton *m_next = nullptr; // 下一级指标 QVBoxLayout *m_layout = nullptr; QHBoxLayout *m_pageLayout = nullptr; bool m_isSettingTable = false; DataTableComboDelegate *m_comboDelegate = nullptr; QList m_data; QString m_uuidStr; bool m_isFillingData = false; int m_schemeStartIndex = -1; // 方案数据开始列 QList m_schemeList; }; #endif // DATATABLEWIDGET_H