Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Login dialog before mainwin
Forum Updated to NodeBB v4.3 + New Features

[Solved] Login dialog before mainwin

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DarkRoast
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      "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]

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DarkRoast
        wrote on last edited by
        #3

        Thanks allot loladiro!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved