#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
connect(ui->btn1,SIGNAL(clicked()),this,SLOT(btn1_slot()));
btn2 = new QPushButton("登录",this);
btn2->resize(430,50);
btn2->move(180,480);
btn2->setStyleSheet("background-color:skyblue");
connect(btn2,&QPushButton::clicked,this,&Widget::btn2_func1);
}
Widget::~Widget()
{
delete ui;
}
void Widget::btn1_slot()
{
this->close();
}
void Widget::btn2_func1()
{
if(ui->userNameEdit->text() == "admin" && ui->passwdEdit->text() == "123456")
{
btn2->setText("登录成功");
this->close();
}
else
{
btn2->setText("登录失败");
ui->passwdEdit->setText("");
}
}
Day11.14
最新推荐文章于 2024-10-08 00:02:21 发布