Widget::Widget(QWidget *parent)
this->setWindowTitle("原神");
this->setWindowIcon(QIcon(":/picture/genshin.png"));
this->setWindowFlag(Qt::FramelessWindowHint);
QMovie *mv = new QMovie(":/picture/leishen.gif");
ui->namelab->setPixmap(QPixmap(":/picture/OIP-C.jpg"));
ui->namelab->resize(30, 30);
ui->namelab->move(ui->naedt->x()-35, ui->naedt->y());
ui->namelab->setScaledContents(true);
ui->pwdlab->setPixmap(QPixmap(":/picture/suo.jpg"));
ui->pwdlab->resize(30, 30);
ui->pwdlab->move(ui->pwdedt->x()-35, ui->pwdedt->y());
ui->pwdlab->setScaledContents(true);
ui->naedt->setPlaceholderText("账号/电话/邮箱");
ui->pwdedt->setPlaceholderText("密码");
this->connect(ui->btn2, SIGNAL(clicked()), this, SLOT(my_close())); //按取消关闭窗口
connect(ui->btn1, &QPushButton::clicked, this, &Widget::my_slot);
if("admin" == ui->naedt->text() && "123456" == ui->pwdedt->text())
int ret = QMessageBox::information(this, "提示", "登录成功", QMessageBox::Ok);
if(QMessageBox::Ok == ret)
emit Jump(); //登陆成功点击ok跳转
QMessageBox::Yes | QMessageBox::No,
int ret = msg.exec(); // 基于属性创建的信息对话框需要执行exec函数才能生成对话框
if(QMessageBox::Yes == ret)
ui->pwdedt->clear(); //Yes清空密码
int ret = QMessageBox::question(this, "问题", "是否退出登录?", QMessageBox::Yes | QMessageBox::No);
if(QMessageBox::Yes == ret)
this->close(); //Yes退出登录界面
Second::Second(QWidget *parent) :
int main(int argc, char *argv[])
QApplication a(argc, argv);
QObject::connect(&w, &Widget::Jump, &s, &Second::my_slot);