Use Qss instead of some image path in code.

This commit is contained in:
Krad
2022-07-14 09:57:05 +08:00
parent 90e41ff7d1
commit 055cb7c7ae
12 changed files with 210 additions and 208 deletions

View File

@@ -15,8 +15,6 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent,
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
QLabel * logo = new QLabel(this);
QPixmap img(":/icons/logo.png");
logo->setPixmap(img.scaledToHeight(33, Qt::SmoothTransformation));
logo->setObjectName("logo");
layout->addWidget(logo);
QLabel * company = new QLabel(this);
@@ -28,8 +26,7 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent,
spacerLine0->setObjectName("smallSpacer");
layout->addWidget(spacerLine0);
QLabel * lbl_msglogo = new QLabel(this);
lbl_msglogo->setObjectName("lbl_msglogo");
lbl_msglogo->setPixmap(QPixmap(":/icons/msg.png").scaledToHeight(26, Qt::SmoothTransformation));
lbl_msglogo->setObjectName("msglogo");
layout->addWidget(lbl_msglogo);
QWidget* widgetMsg = new QWidget(this);
@@ -43,9 +40,9 @@ TopBarWidget::TopBarWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent,
QLabel* nowDate = new QLabel(this);
nowDate->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
QLabel* linkIcon = new QLabel(this);
linkIcon->setPixmap(QPixmap(":/icons/link_g.png").scaledToHeight(22, Qt::SmoothTransformation));
linkIcon->setObjectName("link");
QLabel* readyIcon = new QLabel(this);
readyIcon->setPixmap(QPixmap(":/icons/ready.png").scaledToHeight(22, Qt::SmoothTransformation));
readyIcon->setObjectName("ready");
QLabel* lockIcon = new QLabel(this);
lockIcon->setText("");
// lockIcon->setPixmap(QPixmap(":/icons/lock.png").scaledToHeight(22,Qt::SmoothTransformation));