1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef MATTERELEMENTCONFIGWIDGET_H
- #define MATTERELEMENTCONFIGWIDGET_H
- #include <QLineEdit>
- #include <QStandardItemModel>
- #include <QWidget>
- class CMind;
- struct MEDomain
- {
- QString name;
- QVector<double> leftValues; // 与阈值相关 size == m_domainLevel+1
- QVector<double> rightValues; // 与阈值相关 size == m_domainLevel+1
- QVector<bool> leftCloses;
- QVector<bool> rightCloses;
- };
- struct MEConfigItem
- {
- QString parentName;
- QVector<MEDomain> 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<MEConfigItem> getAllConfigItems() const;
- QStringList getDomainLevels() const;
- QVector<QVector<double>> 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<QLineEdit *> m_levelEdits;
- QList<QStandardItemModel *> m_domainModels; // 配置域的表格集合
- MatterElementItemRangeDelegate *m_meRangeDelegate = nullptr;
- QList<MEConfigItem> m_allConfigItems;
- int m_domainLevel;
- CMind *m_mind = nullptr;
- };
- #endif // MATTERELEMENTCONFIGWIDGET_H
|