#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
this->setWindowIcon(QIcon(":/zh.png"));
ui->lineEdit->setPlaceholderText("账号/手机号/邮箱");
ui->lineEdit_2->setEchoMode(QLineEdit::Password);
ui->lineEdit_2->setPlaceholderText("密码");
this->setWindowFlag(Qt::FramelessWindowHint);
}
void Widget::mousePressEvent(QMouseEvent *event)
{
p=event->pos();
}
void Widget::mouseMoveEvent(QMouseEvent *event)
{
if(event->buttons()==Qt::LeftButton)
{
this->move(event->globalPos()-p);
}
}
Widget::~Widget()
{
delete ui;
}
void Widget::on_pushButton_3_clicked()
{
this->close();
}
void Widget::on_pushButton_5_clicked()
{
if(ui->lineEdit->text()=="zhangsan"||ui->lineEdit_2->text()=="123456")
{
QMessageBox::information(this,"","登录成功");
}
else
{
QMessageBox::information(this,"","登录失败");
}
}
void Widget::on_pushButton_4_clicked()
{
setWindowState(Qt::WindowMinimized);
}
void Widget::on_pushButton_2_clicked()
{
QMessageBox::information(this,"","找回密码");
}