#ifndef MATTERELEMENTCONFIGWIDGET_H #define MATTERELEMENTCONFIGWIDGET_H #include #include #include class CMind; struct MEDomain { QString name; QVector leftValues; // 与阈值相关 size == m_domainLevel+1 QVector rightValues; // 与阈值相关 size == m_domainLevel+1 QVector leftCloses; QVector rightCloses; }; struct MEConfigItem { QString parentName; QVector childs; }; class MatterElementItemRangeDelegate; namespace Ui { class MatterElementConfigWidget; } class MatterElementConfigWidget : public QWidget { Q_OBJECT public: explicit MatterElementConfigWidget(CMind *mind, int domainLevel, QWidget *parent = nullptr); ~MatterElementConfigWidget(); QList getAllConfigItems() const; QStringList getDomainLevels() const; QVector> getScaleValues() const; private: void initScaleDivisionTable(); // 标度划分表 void initDomainLevelLayout(); void initConfigItems(); void initDomainTable(); // 经典域、节域配置 private slots: void onLevelSaveBtnClick(); void onScaleValueUpdate(); void onClearBtnClick(); void onSaveBtnClick(); void onTableItemChanged(QStandardItem *item); private: Ui::MatterElementConfigWidget *ui; QStandardItemModel *m_scaleDivisionmodel = nullptr; QList m_levelEdits; QList m_domainModels; // 配置域的表格集合 MatterElementItemRangeDelegate *m_meRangeDelegate = nullptr; QList m_allConfigItems; int m_domainLevel; CMind *m_mind = nullptr; }; #endif // MATTERELEMENTCONFIGWIDGET_H