[Solved] Login dialog before mainwin



  • Hi all

    I am wondering how I can make a login dialog such that mainwindow wont start before the correct credentials are typed in. ie:

    @int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    MainWindow w;
    
    LoginScreen ls;
    ls.show();
    
    a.processEvents();
    
    w.show(); // this should not show before LoginScreen is finished
    ls.close();
    return a.exec();
    

    }@

    How can I do this ?
    How do I handle if the credentials are wrong, i.e show the LoginScreen again without the mainwindow showing ?

    Thanks
    DarkRoast



  • "QDialog::exec ()":http://doc.qt.nokia.com/4.7/qdialog.html#exec
    [quote]
    Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result.
    [/quote]



  • Thanks allot loladiro!


Log in to reply
 

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