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. Not showing ui when criteria reached.
Forum Updated to NodeBB v4.3 + New Features

Not showing ui when criteria reached.

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 926 Views 2 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.
  • K Offline
    K Offline
    KGWAY
    wrote on last edited by
    #1

    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();
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KGWAY
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KGWAY
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • K Offline
              K Offline
              KGWAY
              wrote on last edited by
              #6

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

              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