PDA

View Full Version : QMain Window Problem



maveric
16th May 2008, 11:12
Hi all,
i am a newbie
i created my application well and good, now i need to implement login window(dialog) to this application.. there are almost 12 ui already done... now i need to implement Login
window

for instance consider in vb.net
there might be n number of forms we can change settings and start from our required form..

so just like that is there any possibility in qt that i could change some settings and display my login window first->(checking validations uname/password)-> firstwindow.ui(Qmain window).....

my login window is a QDialog and my main window is QMain window..

now my problem is i am not able to go from this login window to main window after giving correct password and user name...
like this....

can any one help me out...


thanks in advance

this is code i tried for displaying main window from login dialog....




try
{
QString str="*****";
if(str==PlineEdit2->text()) // here PlineEdit2 is the object name for my password......
{
MainWind MWin(this);
MWin.show();
//QMessageBox::information(this, tr("My Application"), tr("successfully login."),QMessageBox::Ok);
}
else
{
//QMessageBox::information(this, tr("My Application"), tr(logmein),QMessageBox::Ok);
PlineEdit2->clear();
}
}
catch (QString str2)
{
QMessageBox::warning(this, tr("Error"), tr(str2),QMessageBox::Ok);
}

jacek
24th May 2008, 15:51
QWidget::show() is a non-blocking method. Your main window object goes out of scope immediately.