Refactor TopBarWidget & SelectFormWidget.(clean and rename member)

This commit is contained in:
Krad
2022-07-15 17:32:21 +08:00
parent b2ca6d7d68
commit 3ccc8d7fa8
5 changed files with 39 additions and 38 deletions

View File

@@ -3,55 +3,56 @@
//
#include "TopBarWidget.h"
#include <QLabel>
#include <QHBoxLayout>
#include "components/RollingMessageWidget.h"
#include <QDateTime>
#include "components/RollingMessageWidget.h"
#include "event/EventCenter.h"
#include "errorhandle/GUIErrorLW.h"
#include "json/jsonobject.h"
TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) {
QHBoxLayout* layout = new QHBoxLayout(this);
auto layout = new QHBoxLayout(this);
layout->setMargin(0);
QLabel * logo = new QLabel(this);
auto logo = new QLabel(this);
logo->setObjectName("logo");
layout->addWidget(logo);
QLabel * company = new QLabel(this);
auto company = new QLabel(this);
company->setObjectName("company");
layout->addWidget(company);
company->setText(tr("浙江衡玖医疗科技"));
QWidget* spacerLine0 = new QWidget(this);
auto spacerLine0 = new QWidget(this);
spacerLine0->setFixedWidth(2);
spacerLine0->setObjectName("verSpaceLine");
layout->addWidget(spacerLine0);
QLabel * lbl_msglogo = new QLabel(this);
auto lbl_msglogo = new QLabel(this);
lbl_msglogo->setObjectName("msglogo");
layout->addWidget(lbl_msglogo);
QWidget* widgetMsg = new QWidget(this);
auto widgetMsg = new QWidget(this);
layout->addWidget(widgetMsg,1);
widgetMsg->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
layout->addSpacerItem(new QSpacerItem(10, 10, QSizePolicy::Expanding));
QWidget* statusBarWidget = new QWidget(this);
auto statusBarWidget = new QWidget(this);
layout->addWidget(statusBarWidget);
QLabel* hosp = new QLabel(this);
auto hosp = new QLabel(this);
hosp->setText(JsonObject::Instance()->institutionName());
QLabel* nowDate = new QLabel(this);
auto nowDate = new QLabel(this);
nowDate->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
QLabel* linkIcon = new QLabel(this);
auto linkIcon = new QLabel(this);
linkIcon->setObjectName("link");
QLabel* readyIcon = new QLabel(this);
auto readyIcon = new QLabel(this);
readyIcon->setObjectName("ready");
QLabel* lockIcon = new QLabel(this);
auto lockIcon = new QLabel(this);
lockIcon->setText("");
// lockIcon->setPixmap(QPixmap(":/icons/lock.png").scaledToHeight(22,Qt::SmoothTransformation));
QHBoxLayout* status_layout = new QHBoxLayout(statusBarWidget);
auto status_layout = new QHBoxLayout(statusBarWidget);
status_layout->setMargin(0);
status_layout->addWidget(hosp);
status_layout->addWidget(nowDate);
QWidget* spacerLine = new QWidget(this);
auto spacerLine = new QWidget(this);
spacerLine->setFixedWidth(2);
spacerLine->setObjectName("verSpaceLine");
@@ -60,7 +61,7 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent,
layout->addWidget(readyIcon);
layout->addWidget(lockIcon);
QVBoxLayout* l = new QVBoxLayout(widgetMsg);
auto l = new QVBoxLayout(widgetMsg);
l->setMargin(0);
auto w = new RollingMessageWidget(this);