123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- #ifndef CONFIGEXPERTDATAWIDGET_H
- #define CONFIGEXPERTDATAWIDGET_H
- #include <QWidget>
- #include "SchemePlanManager.h"
- #include <QMap>
- 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<NodeMatrixInfo *> 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<QFUser *> m_expertList;
- QList<UserConfig *> m_configList;
- QMap<QString, QList<NodeMatrixInfo *>> m_nodeData; // 按组归类的专家数据
- };
- #endif // CONFIGEXPERTDATAWIDGET_H
|