|
@@ -1,6 +1,62 @@
|
|
|
-#include "ExpertView.h"
|
|
|
+#include "ExpertView.h"
|
|
|
+
|
|
|
+#include "ExpertInfoView.h"
|
|
|
+
|
|
|
+#include <Widgets/Button.h>
|
|
|
+#include <Widgets/LineEdit.h>
|
|
|
+
|
|
|
+#include <QBoxLayout>
|
|
|
+#include <QLabel>
|
|
|
+
|
|
|
+#include <QDebug>
|
|
|
|
|
|
ExpertView::ExpertView(QWidget *parent) : QWidget(parent)
|
|
|
{
|
|
|
+ initialize();
|
|
|
+ initLayout();
|
|
|
+ connectSignalsAndSlots();
|
|
|
+}
|
|
|
+
|
|
|
+void ExpertView::initialize()
|
|
|
+{
|
|
|
+ m_vBoxLayout = new QVBoxLayout(this);
|
|
|
+
|
|
|
+ m_titleLabel = new QLabel(this);
|
|
|
+ m_titleLabel->setText("用户列表");
|
|
|
+ QFont ft("Microsoft YaHei", 12);
|
|
|
+ m_titleLabel->setFont(ft);
|
|
|
+ m_hBoxLayout = new QHBoxLayout();
|
|
|
+ m_searchLineEdit = new SearchLineEdit(this);
|
|
|
+ m_searchLineEdit->setPlaceholderText("搜索用户");
|
|
|
+ m_searchLineEdit->setMinimumWidth(300);
|
|
|
+ m_addExpertPushButton = new PushButton("添加用户", NEWFLICON(FluentIcon, ADD), this);
|
|
|
+
|
|
|
+ m_expertInfoView = new ExpertInfoView(this);
|
|
|
+}
|
|
|
|
|
|
+void ExpertView::initLayout()
|
|
|
+{
|
|
|
+ m_vBoxLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
|
|
|
+ m_vBoxLayout->setContentsMargins(15, 10, 10, 15);
|
|
|
+ m_vBoxLayout->addLayout(m_hBoxLayout);
|
|
|
+
|
|
|
+ m_hBoxLayout->addWidget(m_titleLabel);
|
|
|
+ m_hBoxLayout->addSpacing(15);
|
|
|
+ m_hBoxLayout->addWidget(m_searchLineEdit, 0, Qt::AlignLeft);
|
|
|
+ m_hBoxLayout->addWidget(m_addExpertPushButton, 1, Qt::AlignLeft);
|
|
|
+
|
|
|
+ m_vBoxLayout->addSpacing(15);
|
|
|
+}
|
|
|
+
|
|
|
+void ExpertView::connectSignalsAndSlots()
|
|
|
+{
|
|
|
+ connect(m_addExpertPushButton, &PushButton::clicked, this, &ExpertView::slotAddExpertClicked);
|
|
|
+}
|
|
|
+
|
|
|
+void ExpertView::slotAddExpertClicked()
|
|
|
+{
|
|
|
+ if (m_expertInfoView->isVisible() == false) {
|
|
|
+ m_expertInfoView->clearInputs();
|
|
|
+ m_expertInfoView->show();
|
|
|
+ }
|
|
|
}
|