PDA

View Full Version : visible main form?



triperzonak
12th June 2008, 08:22
hi.

i create a form main and form for login, at the start of the program i will call the login form then if ok enable main form or if cancel exit..

my problem is when i call the form login in class constructor at the start of the program, i only see the login form without the main form. what i want is to see both at the start of the program but login form as modal. how?

tnks

wysota
12th June 2008, 09:00
int main(...){
QApplication app(...);
MainWindow mw;
mw.show();
QTimer::singleShot(0, &mw, SLOT(displayLogin());
return app.exec();
}

class MainWindow ... {
...
public slots:
void displayLogin(){
LoginDialog dlg(this);
dlg.exec();
}
};