chengxr 1 year ago
parent
commit
b888fe3eb9

+ 2 - 2
QFD/QFD.pro

@@ -72,10 +72,10 @@ SOURCES += \
     view/SettingView.cpp \
     view/UserView.cpp \
     widgets/AppInfoWidget.cpp \
+    widgets/ConfigExpertWidget.cpp \
     widgets/CreateProjWidget.cpp \
     widgets/CustomTitleBar.cpp \
     widgets/EvaluateDataWidget.cpp \
-    widgets/ExpertConfigInfoWidget.cpp \
     widgets/ExpertInfoWidget.cpp \
     widgets/ExpertListWidget.cpp \
     widgets/ImportExpertDataWidget.cpp \
@@ -97,10 +97,10 @@ HEADERS += \
     view/SettingView.h \
     view/UserView.h \
     widgets/AppInfoWidget.h \
+    widgets/ConfigExpertWidget.h \
     widgets/CreateProjWidget.h \
     widgets/CustomTitleBar.h \
     widgets/EvaluateDataWidget.h \
-    widgets/ExpertConfigInfoWidget.h \
     widgets/ExpertInfoWidget.h \
     widgets/ExpertListWidget.h \
     widgets/ImportExpertDataWidget.h \

+ 10 - 4
QFD/view/ProjectView.cpp

@@ -2,6 +2,7 @@
 
 #include "ProjectListWidget.h"
 #include "RenameWidget.h"
+#include "ConfigExpertWidget.h"
 
 #include <Widgets/Button.h>
 #include <Widgets/LineEdit.h>
@@ -21,7 +22,7 @@ void ProjectView::initialize()
     m_hBoxLayout = new QHBoxLayout(this);
 
     m_listWidget = new QWidget(this);
-    m_listWidget->setFixedWidth(300);
+    m_listWidget->setFixedWidth(260);
 
     QPalette pal(m_listWidget->palette());
     pal.setColor(QPalette::Background, QColor("#f3f3f3"));
@@ -41,13 +42,17 @@ void ProjectView::initialize()
     m_deleteButton = new ToolButton(NEWFLICON(FluentIcon, DELETE), this);
     m_deleteButton->setToolTip("删除工程");
 
-    m_projListWidget   = new ProjectListWidget(this);
+    m_projListWidget = new ProjectListWidget(this);
+
     m_projDetailWidget = new QWidget(this);
-    m_projLayout       = new QVBoxLayout();
+    m_projLayout       = new QVBoxLayout(m_projDetailWidget);
 
     m_projNameLabel = new QLabel(this);
     m_projNameLabel->setText("工程名");
 
+    m_configExpWidget = new ConfigExpertWidget(this);
+    m_configExpWidget->setFixedWidth(260);
+
     m_renameWidget = new RenameWidget(this);
 }
 
@@ -67,8 +72,9 @@ void ProjectView::initLayout()
 
     m_hBoxLayout->addWidget(m_projDetailWidget);
 
-    m_projDetailWidget->setLayout(m_projLayout);
     m_projLayout->addWidget(m_projNameLabel, Qt::AlignTop);
+
+    m_hBoxLayout->addWidget(m_configExpWidget, Qt::AlignRight);
 }
 
 void ProjectView::connectSiganlsAndSlots()

+ 3 - 0
QFD/view/ProjectView.h

@@ -4,6 +4,7 @@
 #include <QWidget>
 
 class ProjectListWidget;
+class ConfigExpertWidget;
 
 class RenameWidget;
 
@@ -46,6 +47,8 @@ private:
     QVBoxLayout *m_projLayout   = nullptr;
     QLabel *m_projNameLabel     = nullptr;
 
+    ConfigExpertWidget *m_configExpWidget = nullptr;
+
     RenameWidget *m_renameWidget = nullptr;
 };
 

+ 49 - 0
QFD/widgets/ConfigExpertWidget.cpp

@@ -0,0 +1,49 @@
+#include "ConfigExpertWidget.h"
+
+#include <QBoxLayout>
+#include <QSplitter>
+#include <QLabel>
+
+ConfigExpertWidget::ConfigExpertWidget(QWidget *parent) : QWidget(parent)
+{
+    initialize();
+    initLayout();
+    connectSignalsAndSlots();
+}
+
+void ConfigExpertWidget::initialize()
+{
+    QPalette pal(palette());
+    pal.setColor(QPalette::Background, QColor("#eeeeee"));
+    setAutoFillBackground(true);
+    setPalette(pal);
+
+    m_vBoxLayout = new QVBoxLayout(this);
+    m_titleLabel = new QLabel("配置专家", this);
+    m_titleLabel->setObjectName("titleLabel");
+    m_splitter = new QSplitter(Qt::Vertical, this);
+    m_splitter->setChildrenCollapsible(false);
+}
+
+void ConfigExpertWidget::initLayout()
+{
+    m_vBoxLayout->setMargin(0);
+    m_vBoxLayout->addWidget(m_titleLabel);
+    m_vBoxLayout->addWidget(m_splitter);
+
+    QWidget *w1 = new QWidget();
+    QWidget *w2 = new QWidget();
+    w1->setMinimumHeight(100);
+    w2->setMinimumHeight(100);
+
+    w1->setStyleSheet("background-color:#f4f4f4");
+    w2->setStyleSheet("background-color:#f4f4f4");
+
+    m_splitter->addWidget(w1);
+    m_splitter->addWidget(w2);
+
+    m_splitter->setStretchFactor(0, 2);
+    m_splitter->setStretchFactor(1, 3);
+}
+
+void ConfigExpertWidget::connectSignalsAndSlots() { }

+ 32 - 0
QFD/widgets/ConfigExpertWidget.h

@@ -0,0 +1,32 @@
+#ifndef CONFIGEXPERTWIDGET_H
+#define CONFIGEXPERTWIDGET_H
+
+#include <QWidget>
+
+class ToolButton;
+class PushButton;
+
+class QVBoxLayout;
+class QLabel;
+class QSplitter;
+class QPushButton;
+
+class ConfigExpertWidget : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit ConfigExpertWidget(QWidget *parent = nullptr);
+
+    void initialize();
+    void initLayout();
+    void connectSignalsAndSlots();
+
+signals:
+
+private:
+    QVBoxLayout *m_vBoxLayout = nullptr;
+    QLabel *m_titleLabel      = nullptr;
+    QSplitter *m_splitter     = nullptr;
+};
+
+#endif  // CONFIGEXPERTWIDGET_H

+ 0 - 6
QFD/widgets/ExpertConfigInfoWidget.cpp

@@ -1,6 +0,0 @@
-#include "ExpertConfigInfoWidget.h"
-
-ExpertConfigInfoWidget::ExpertConfigInfoWidget(QWidget *parent) : QWidget(parent)
-{
-
-}

+ 0 - 19
QFD/widgets/ExpertConfigInfoWidget.h

@@ -1,19 +0,0 @@
-#ifndef EXPERTCONFIGINFOWIDGET_H
-#define EXPERTCONFIGINFOWIDGET_H
-
-#include <QWidget>
-
-///
-/// \brief The ExpertConfigInfoWidget class
-/// 专家配置信息表
-///
-class ExpertConfigInfoWidget : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit ExpertConfigInfoWidget(QWidget *parent = nullptr);
-
-signals:
-};
-
-#endif  // EXPERTCONFIGINFOWIDGET_H