#include "my.h"
#include "ui_my.h"
my::my(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::my)
, speecher(new QTextToSpeech(this))
{
this->setWindowFlag(Qt::FramelessWindowHint);
ui->setupUi(this);
ui->label->setPixmap(QPixmap(":/png/preview2.png"));
ui->label->setScaledContents(true);
ui->password->setEchoMode(QLineEdit::Password);
this->setFixedSize(486,402);
}
my::~my()
{
delete ui;
}
void my::on_exit_clicked()
{
QMessageBox msg(QMessageBox::Question,
"提示",
"是否退出登录?",
QMessageBox::Yes |QMessageBox::No,
this
);
int ret = msg.exec();
if(ret == QMessageBox::Yes)
{
this->close();
}
else{}
}
void my::on_log_in_clicked()
{
QString id,password;
id = ui->account->text();
password = ui->password->text();
if(id == "admin" && password == "123456")
{
this->close();
emit my_jump();
}
else
{
QMessageBox msg(QMessageBox::Warning,
"错误",
"账号或密码错误!是否重新登陆。",
QMessageBox::Yes |QMessageBox::No,
this
);
int ret = msg.exec();
if(ret == QMessageBox::Yes)
{
ui->account->clear();
ui->password->clear();
}
else
{
this->close();
}
}
}
09-11
09-11
09-11