#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
, btn2(new QPushButton("登录",this))
{
ui->setupUi(this);
this->btn2->move(250,219);
btn2->resize(91,31);
connect(btn2,SIGNAL(clicked()),this,SLOT(my_slot()));
}
Widget::~Widget()
{
delete ui;
}
void Widget::my_slot()
{
if(ui->username->text() == "admin" && ui->passwd->text() == "123456")
{
qDebug() << "登陆成功" << endl;
this->close();
}
else
{
qDebug() << "登陆失败" << endl;
ui->username->clear();
ui->passwd->clear();
}
}
void Widget::on_btn1_clicked()
{
this->close();
}
2024.9.9 QT
最新推荐文章于 2024-09-13 16:39:43 发布