(提问)QT登陆界面的跳转问题
我是在AS4,qt designer做的,主程序界面已经完成,登录界面和主程序界面单独运行都是正常的,就是在点击确定不能弹出主窗口,在main()中可以同时将两个界面都show()出来,要是在主窗口show()的时候弹出informationDialog() , 这时主界面可以弹出来,但是不能点击,登录判断程序如下:
#include <qmessagebox.h>
#include <stdio.h>
#include "form1.h"
QString uName = "admin";
QString pWord = "admin";
void LogForm::log_clicked()
{
QString inputName = lineEdit_name->text();
QString inputPwd = lineEdit_pswd->text();
if(inputPwd == "" || inputName == "")
{
QMessageBox::information(this,"Err",
QString::fromLocal8Bit( "密码或用户名不能为空!"),
QMessageBox::Retry | QMessageBox::Default);
}
else if(inputPwd != pWord || inputName != uName)
{
QMessageBox::information(this,"Err",
QString::fromLocal8Bit( "密码或用户名错误!"),
QMessageBox::Retry | QMessageBox::Default);
}
else
{
Form1 w;
w.show();
this->hide();
//QMessageBox::information(this,"OK",
// QString::fromLocal8Bit( "OK"));
}
}
请各位达人相助.....