#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->logoLab->setPixmap(QPixmap(":/C:/Users/l1693/Desktop/pictures/1.png"));
ui->logoLab->setScaledContents(true);
connect(ui->btn2,SIGNAL(clicked()),this,SLOT(my_slot()));
connect(ui->btn1,SIGNAL(clicked()),this,SLOT(my_slot1()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::my_slot()
{
close();
}
void MainWindow::my_slot1()
{
if(ui->userNameEdit->text() == "admin" && ui->passwdEdit->text() == "123456")
{
QLabel *lab1 = new QLabel("登陆成功",this);
lab1->resize(200,100);
lab1->move(0,0);
close();
}
else
{
ui->passwdEdit->text() = "";
QLabel *lab1 = new QLabel("登录失败",this);
lab1->resize(200,100);
lab1->move(0,0);
}
}