chengxr 1 year ago
parent
commit
a6d96c2d22
2 changed files with 4 additions and 7 deletions
  1. 4 6
      QFD/widgets/LoginWidget.cpp
  2. 0 1
      QFD/widgets/LoginWidget.h

+ 4 - 6
QFD/widgets/LoginWidget.cpp

@@ -41,11 +41,10 @@ void LoginWidget::initialize()
     m_pwLineEdit->setEchoMode(QLineEdit::Password);
 
     m_remLayout   = new QHBoxLayout();
-    m_remCheckBox = new CheckBox(" ", this);
-    m_remCheckBox->setMaximumWidth(20);
-    m_remLabel = new QLabel(this);
-    m_remLabel->setText("记住密码");
-    m_remLabel->setStyleSheet("color:#ffffff;");
+    m_remCheckBox = new CheckBox("记住密码", this);
+
+    const QString &s = m_remCheckBox->styleSheet() + "CheckBox {color:white}";
+    m_remCheckBox->setStyleSheet(s);
 
     m_buttonLayout = new QHBoxLayout();
     m_loginButton  = new PushButton("登录", this);
@@ -66,7 +65,6 @@ void LoginWidget::initLayout()
 
     m_vBoxLayout->addLayout(m_remLayout);
     m_remLayout->addWidget(m_remCheckBox);
-    m_remLayout->addWidget(m_remLabel);
     m_remLayout->addSpacing(30);
 
     m_vBoxLayout->addSpacing(40);

+ 0 - 1
QFD/widgets/LoginWidget.h

@@ -38,7 +38,6 @@ private:
 
     QHBoxLayout *m_remLayout = nullptr;
     CheckBox *m_remCheckBox  = nullptr;
-    QLabel *m_remLabel       = nullptr;
 
     QHBoxLayout *m_buttonLayout = nullptr;
     PushButton *m_loginButton   = nullptr;