widget.cpp
#include "widget.h"
#include<QDebug>
//实现槽函数
void Widget::login1()
{
QString user=username_input->text();
QString pass=password_input->text();
//如果不勾选无法登入
if(!check->isChecked()){
qDebug()<<"xxx"<<endl;
return;
}
if("123"==user&&"123"==pass){
qDebug()<<"登入成功";
this->close();
}else{
//错误清空
password_input->setText("");
}
}
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
this->resize(468,657);
//创建头像标签
avatar=new QLabel(this);
//移动位置
avatar->resize(114,114);
avatar->setStyleSheet(" border-radius: 50px;");
avatar->move((this->width()-avatar->width())/2,95);
//加载图片
avatar->setPixmap(QPixmap("C:\\Users\\xzq\\Desktop\\a