Not showing ui when criteria reached.
-
Hello,
I currently have two separate UI's that work independently but one transfers information to the other. The first being a login screen, upon logging in the second window appears. However, the first window stays open (I can't click it or anything but if I move my second window around I can see it behind). My main.ccp has the login showing and the other one is coded to show when username and password are entered (Works correctly). but since the main is a int it's not updated and I'm not sure how to connect to update to not show it once it's logged in. Thanks
main.ccp
int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; Login p; QObject::connect(&p,SIGNAL(usernameupdated(QString)),&w,SLOT(username_received(QString))); QObject::connect(&p,SIGNAL(passwordupdated(QString)),&w,SLOT(password_received(QString))); p.show(); p.update(); return a.exec(); }
-
Hi,
Why not do the validation in Login and only show MainWindow after your close Login ?
-
It's not the responsibility of your main window to close your login window. It should close itself after emitting the signal or you should have a manager that handles your different windows.