12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include "HomeView.h"
- #include <Widgets/Button.h>
- #include <Widgets/LineEdit.h>
- #include <QBoxLayout>
- #include <QLabel>
- HomeView::HomeView(QWidget *parent) : QWidget(parent)
- {
- initialize();
- initLayout();
- connectSignalsAndSlots();
- // this->setStyleSheet("background-color: rgb(250, 250, 250);");
- }
- void HomeView::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_createProjPushButton = new PushButton("新建工程", NEWFLICON(FluentIcon, ADD), this);
- }
- void HomeView::initLayout()
- {
- m_vBoxLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
- m_vBoxLayout->setContentsMargins(100, 10, 0, 0);
- m_vBoxLayout->addLayout(m_hBoxLayout);
- m_hBoxLayout->addSpacing(10);
- m_hBoxLayout->addWidget(m_titleLabel);
- m_hBoxLayout->addSpacing(15);
- m_hBoxLayout->addWidget(m_searchLineEdit, 0, Qt::AlignLeft);
- m_hBoxLayout->addWidget(m_createProjPushButton, 1, Qt::AlignLeft);
- }
- void HomeView::connectSignalsAndSlots() { }
|