学前端去哪个培训机构,网站如何做搜索引擎优化,燕郊做网站,辽宁建设工程人才网作业
2 在登录界面的登录取消按钮进行以下设置#xff1a; 使用手动连接#xff0c;将登录框中的取消按钮使用第2种方式的连接到自定义的槽函数中#xff0c;在自定义的槽函数中调用关闭函数 将登录按钮使用qt4版本的连接到自定义的槽函数中#xff0c;在槽函数中判断…作业
2 在登录界面的登录取消按钮进行以下设置 使用手动连接将登录框中的取消按钮使用第2种方式的连接到自定义的槽函数中在自定义的槽函数中调用关闭函数 将登录按钮使用qt4版本的连接到自定义的槽函数中在槽函数中判断ui界面上输入的账号是否为admin密码是否为123456,如果账号密码匹配成功则输出“登录成功”并关闭该界面如果匹配失败则输出登录失败并将密码框中的内容清空
#include mainwindow.h
#include ui_mainwindow.hMainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui-setupUi(this);ui-logo_lab-setPixmap(QPixmap(:/pictrue/logo.png));ui-logo_lab-setScaledContents(true);ui-login_lab-setPixmap(QPixmap(:/pictrue/login_1.png));ui-login_lab-setScaledContents(true);ui-passwd_lab-setPixmap(QPixmap(:/pictrue/passwd.jpg));ui-passwd_lab-setScaledContents(true);ui-password_edit-setEchoMode(QLineEdit::Password);connect(ui-login_Button,SIGNAL(clicked()),this,SLOT(on_login_Button_clicked()));
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::on_register_Button_clicked()
{this-close();
}void MainWindow::on_login_Button_clicked()
{QMessageBox *msg new QMessageBox(this);if(ui-userneam_Edit-text() admin ui-password_edit-text() 123456){//qDebug() 登录成功;msg-setText(登录成功);msg-setWindowTitle(提示);msg-open();}else{qDebug() 用户名或密码错误;}
}