Qt World Summit: Register Today!

[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;
    w.show(); // this should not show before LoginScreen is finished
    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 ?


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

  • Thanks allot loladiro!

Log in to reply