title: QMainWindow not showing up
body: <p>I have made a quick test program which doesn't seem to bring up anything when executed. Here is my code:</p>
  
  <h3>z_lock.h</h3>
  
  <pre><code>#ifndef Z_LOCK_H
  #define Z_LOCK_H
  
  #include &lt;QtGui&gt;
  
  class z_lock : public QMainWindow
  {
  Q_OBJECT
  public:
      z_lock();
  private slots:
      void password_check();
      void quit();
  private:
      QStackedWidget *book;
      QWidget *page1;
      QWidget *page2;
      QLineEdit *input;
  };
  #endif
  </code></pre>
  
  <h3>z_lock.cpp</h3>
  
  <pre><code>#include "z_lock.h"
  
  z_lock::z_lock(){
      book = new QStackedWidget;
  
      //page1
      page1 = new QWidget;
      QLabel *label1 = new QLabel("Enter password.");
      input = new QLineEdit;
      QPushButton *goButton = new QPushButton("Go");
  
      connect(goButton, SIGNAL(clicked()), this, SLOT(password_check()));
  
      QHBoxLayout *layout1;
      layout1 -&gt; addWidget(label1);
      layout1 -&gt; addWidget(input);
      layout1 -&gt; addWidget(goButton);
      page1 -&gt; setLayout(layout1);
  
      //page2
      page2 = new QWidget;
      QLabel *label2 = new QLabel("Welcome, you're in.");
      QVBoxLayout *layout2;
      layout2 -&gt; addWidget(label2);
      page2 -&gt; setLayout(layout2);
  
      book -&gt; addWidget(page1);
      book -&gt; addWidget(page2);
      setCentralWidget(book);
  }
  
  void z_lock::quit(){
      close();
  }
  
  void z_lock::password_check(){
      QString guess = input -&gt; text();
      if (guess == "apple"){
          z_lock::book -&gt; setCurrentIndex(1);
      }
  }
  </code></pre>
  
  <h3>main.cpp</h3>
  
  <pre><code>#include "z_lock.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
      z_lock *that;
      that -&gt; show();
  
      return app.exec();
  }
  </code></pre>
  
  <p>Please, any help would do. I have carried out research about everything to do with QMainWindow and still nothing. This will probably be stupidly easy to solve and I'm sorry for such a basic question. </p>