title: How to organize a system of parent and child windows that hide their parent. QT
body: <p>Let’s say I have a main window.</p>
  
  <p>Then when I click a button I want a child window to open up and that main windows to hide.
  Then when I close that child window i want the main windows to reappear.</p>
  
  <p>Right now I’m opening up that child window by doing:</p>
  
  <pre><code>s=new SignUpWindow(NULL,temp);
  s-&gt;show();
  </code></pre>
  
  <p>where s is a private pointer of my main window.</p>
  
  <p>When I try to do:</p>
  
  <pre><code>s=new SignUpWindow(this,temp);
  s-&gt;show();
  </code></pre>
  
  <p>The s window doesn’t show up.</p>
  
  <p>Here is the signature of it’s constructor in it's header:</p>
  
  <pre><code>SignUpWindow (QWidget* parent=NULL, Netflix *n=NULL);
  </code></pre>
  
  <p>Can someone also explain why we set parent to NULL in the header? 
  I sometimes get issues when I try to play around with it's parameters and get errors like:</p>
  
  <blockquote>
    <p>candidate expects 1 argument,  2 provided qt</p>
  </blockquote>
  
  <p>Thanks for all you're help
  -A tired college student just learning qt</p>
  
  <p><em>UPDATE</em>
  the following is essentially the header for my main window:</p>
  
  <pre><code>class LoginWindow : public QWidget
  {
  
      Q_OBJECT
  
      public:
          LoginWindow (QWidget* parent=NULL, Netflix *n=NULL);
  
      public slots:
          void loggedIn();
          void newUser();
          void quitPushed();
  
  
      private:
          QPushButton *quitButton, *loginButton, *newUserButton;
          QLineEdit *login;//this is the text area that takes in the loginID    
  };
  
  #endif
  </code></pre>
  
  <p>then there is a function that is initiated by a button click that opens up a new windows:</p>
  
  <pre><code>void LoginWindow::newUser()
  {
          s=new SignUpWindow(NULL,temp);
          s-&gt;show();
          //this-&gt;hide();
  }
  </code></pre>
  
  <p>How would I connect <strong>s</strong> to LogInWindow?</p>
  
  <p><strong>UPDATE 2</strong>
  SignUpWIndow.h:</p>
  
  <pre><code>class SignUpWindow : public QWidget
  {
  
      Q_OBJECT
  
      public:
          SignUpWindow (QWidget* parent=NULL, Netflix *n=NULL);
  
  
      public slots:
  
      private:
   };
  </code></pre>
  
  <p>SignUpWindow.cpp:</p>
  
  <pre><code>SignUpWindow::SignUpWindow (QWidget* parent, Netflix *n) : QWidget (parent)
  {
      QVBoxLayout *mainLayout = new QVBoxLayout;
      //then i add things like buttons and group boxes and etc but no dialogs...
  }
  </code></pre>
  
  <p>I never made a dialog for my SignUpWindow. I just added layouts and buttons etc.</p>