在昨天的基础上完成信号与槽函数,实现界面跳转
#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
this->setFixedSize(550,450);
this->setWindowTitle("QQ");
this->setWindowIcon(QIcon(":/icon_resource/QQ.png"));
connect(ui->Change_page,SIGNAL(clicked()),this,SLOT(on_Change_page_clicked()));
PNG_lab = new QLabel(this);
PNG_lab->resize(550,158);
PNG_lab->setPixmap(QPixmap(":/icon_resource/R-C.jpg"));
PNG_lab->setScaledContents(true);
}
Widget::~Widget()
{
delete ui;
}
void Widget::on_Change_page_clicked()
{
//发送跳转信号
emit jump();
//登录
QString Account_Edit = ui->Account_Edit->text();
QString Password_Edit = ui->Password_Edit->text();
if(Account_Edit=="admin" && Password_Edit=="123456")
{
qDebug()<<"Load Success";
}
else
{
qDebug()<<"Load Fail";
}
this->hide();//隐藏界面
}