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. Main Window Hide and Show from another dialogue form

Main Window Hide and Show from another dialogue form

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 713 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.
  • A Offline
    A Offline
    arkantos.tas
    wrote on last edited by
    #1

    Hi, I'm a newbie and in my program I'm just simply trying to create a login form. When the user logs in there is a option to log out. When the user logs out I want to show the main window again. But i'm unable to do so. I can hide the main window but can't bring it back. Any ideas how I might solve the problem

    Taz742T jsulmJ 3 Replies Last reply
    0
    • A arkantos.tas

      Hi, I'm a newbie and in my program I'm just simply trying to create a login form. When the user logs in there is a option to log out. When the user logs out I want to show the main window again. But i'm unable to do so. I can hide the main window but can't bring it back. Any ideas how I might solve the problem

      Taz742T Offline
      Taz742T Offline
      Taz742
      wrote on last edited by Taz742
      #2

      @arkantos.tas
      Hi.
      while you show mainwindow, create dialog and show this.

          MainWindow w;
      
          UserLoginDlg* mydlg = new UserLoginDlg();
      
          mydlg->setModal(true);
      
          if(mydlg->exec() == QDialog::Accepted){
              w.show();
          }else return -1;
      

      QDialog::Accepted
      Means that the user has to log in. username and password is Correct.

      Now left with only two things to do in the dialogue.

      if user correct then:

      void UserLoginDlg::on_Log_In_clicked()
      {
      QDialog::accept();
      }

      if user incorrect:
      void UserLoginDlg::on_Log_Out_clicked() or The user then cut form
      {
      QDialog::reject();
      }

      Do what you want.

      1 Reply Last reply
      0
      • A arkantos.tas

        Hi, I'm a newbie and in my program I'm just simply trying to create a login form. When the user logs in there is a option to log out. When the user logs out I want to show the main window again. But i'm unable to do so. I can hide the main window but can't bring it back. Any ideas how I might solve the problem

        Taz742T Offline
        Taz742T Offline
        Taz742
        wrote on last edited by
        #3

        @arkantos.tas
        ohh, sorry I did not see the problem correctly. I think I wrote the wrong answer.

        Do what you want.

        1 Reply Last reply
        0
        • A arkantos.tas

          Hi, I'm a newbie and in my program I'm just simply trying to create a login form. When the user logs in there is a option to log out. When the user logs out I want to show the main window again. But i'm unable to do so. I can hide the main window but can't bring it back. Any ideas how I might solve the problem

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @arkantos.tas How do you try to show the main window again?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          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