#ifndef CONFIGEXPERTDATAWIDGET_H #define CONFIGEXPERTDATAWIDGET_H #include #include "SchemePlanManager.h" #include class NodeMatrixInfo; class QFUser; class UserConfig; class ToolButton; class PushButton; class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QLabel; class QSplitter; class QPushButton; class QListWidget; class QSpinBox; /** * @brief The ConfigListItemWidget class * 自定义专家配置列表条目 */ class ConfigListItemWidget : public QWidget { Q_OBJECT public: explicit ConfigListItemWidget(QWidget *parent = nullptr); UserConfig *userConfig() const; void setUserConfig(UserConfig *config); void setImported(bool imported); int spinValue() const; signals: void sigImport(UserConfig *config); void sigRemove(UserConfig *config); private: void initWidget(); void initLayouts(); void connectSignalsAndSlots(); private slots: void slotImport(); void slotRemove(); private: UserConfig *m_config = nullptr; QLabel *m_name = nullptr; QSpinBox *m_weight = nullptr; QPushButton *m_import = nullptr; QPushButton *m_remove = nullptr; QHBoxLayout *m_layout = nullptr; }; /** * @brief The ExpertListItemWidget class * 自定义专家列表条目 */ class ExpertListItemWidget : public QWidget { Q_OBJECT public: explicit ExpertListItemWidget(QWidget *parent = nullptr); QFUser *user() const; void setUser(QFUser *user); void setIndex(int index); void setAdded(bool added); signals: void sigAddUser(QFUser *user); private: void initWidget(); void initLayout(); void connectSignalsAndSlots(); private: void slotAdd(); private: QFUser *m_user = nullptr; QLabel *m_index = nullptr; QLabel *m_name = nullptr; QPushButton *m_add = nullptr; QHBoxLayout *m_layout = nullptr; }; /** * @brief The ConfigExpertDataWidget class * 专家配置和导入专家数据视图 */ class ConfigExpertDataWidget : public QWidget { Q_OBJECT public: explicit ConfigExpertDataWidget(QWidget *parent = nullptr); void initialize(); void initLayout(); void connectSignalsAndSlots(); void setProcess(SchemePlanManager::SchemeProcessInfo process); void loadData(); void loadExpert(); void loadConfig(); void loadNodeData(); void selectFirstImported(); void selectConfig(UserConfig *config); QList selectedData(); signals: void sigImportData(UserConfig *config); void sigConfigCurrentChanged(); protected: virtual void showEvent(QShowEvent *event) override; virtual void hideEvent(QHideEvent *event) override; private: void refreshConfigList(); void refreshExpList(); private slots: void slotSave(); void slotRefresh(); void slotAddUser(QFUser *user); void slotRemoveConfig(UserConfig *config); void slotImportData(UserConfig *config); void slotUserConfigCurrentChanged(); private: SchemePlanManager::SchemeProcessInfo m_process; bool m_isProcessChanged = false; QVBoxLayout *m_vBoxLayout = nullptr; QLabel *m_titleLabel = nullptr; QSplitter *m_splitter = nullptr; QWidget *m_configWidget = nullptr; QVBoxLayout *m_configWidgetLayout = nullptr; QWidget *m_configListHeader = nullptr; QHBoxLayout *m_configListHeaderLayout = nullptr; QLabel *m_configListTitleLabel = nullptr; QLabel *m_configListTipsLabel = nullptr; QPushButton *m_saveButton = nullptr; QListWidget *m_configListWidget = nullptr; QWidget *m_expWidget = nullptr; QVBoxLayout *m_expWidgetLayout = nullptr; QWidget *m_expListHeader = nullptr; QHBoxLayout *m_expListHeaderLayout = nullptr; QLabel *m_expListTitleLabel = nullptr; QPushButton *m_refreshButton = nullptr; QListWidget *m_expListWidget = nullptr; QList m_expertList; QList m_configList; QMap> m_nodeData; // 按组归类的专家数据 }; #endif // CONFIGEXPERTDATAWIDGET_H