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();
    }
    

  • Lifetime Qt Champion

    Hi,

    Why not do the validation in Login and only show MainWindow after your close Login ?



  • Thank you, I didn't think to do it that way!



  • I'm trying to emit a signal whenever I press the login button on the Login screen that I'll connect to a slot in the mainwindow. However I'm not sure how to set up that slot to close the login window.


  • Lifetime Qt Champion

    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.



  • Ok I'll try to figure out how to do so. Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.