Reputation: 1133
I have a main window and a dialog window in QT. I want users to login first before proceeding to the main window. Oh yes, the dialog window is my login page. Can advice on how to proceed. I got a button btnSubmit which connects to a slot called getLoginDetails(). How can i make sure the user has login before proceeding to the main window. When i type this, there is no errors but the Login Form is not appearing.
int main (){
QApplication app(argc, argv);
LoginAccess objLA;
bool status;
status = objLA.getLoginDetails2();
if (status==false){
LoginForm objL;
objL.show();
}else{
mainForm objM;
objM.show();
}
}
Upvotes: 0
Views: 143
Reputation: 96147
You need an application.exec() to start the event loop - even if you are doign a modal dialog first
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow win;
LoginAccess objLA;
if ( ! objLA.getLoginDetails2() ) {
exit(1);
}
win.show();
return app.exec();
}
Upvotes: 1