title: Qt, can't display child widget
body: <p>I have two widgets defined as follows</p>
  
  <pre><code>class mainWindow : public QWidget
  {
      Q_OBJECT
  public:
      mainWindow();
      void readConfig();
  private:
      SWindow *config;
      QVector &lt;QString&gt; filePath;
      QVector &lt;QLabel*&gt; alias,procStatus;
      QVector &lt;int&gt; delay;
      QGridLayout *mainLayout;
      QVector&lt;QPushButton*&gt; stopButton,restartButton;
      QVector&lt;QProcess*&gt; proc;
      QSignalMapper *stateSignalMapper, *stopSignalMapper, *restartSignalMapper;
  public slots:
      void openSettings();
      void startRunning();
      void statusChange(int);
      void stopProc(int);
      void restartProc(int);
      void renew();
  };
  class SWindow : public QWidget
  {
      Q_OBJECT
  public:
      SWindow(QWidget *parent=0);
      void readConfig();
      void addLine(int);
  private:
      QVector&lt;QPushButton*&gt; selectButton;
      QVector&lt;QLabel*&gt; filePath;
      QVector&lt;QLineEdit*&gt; alias;
      QSignalMapper *selectSignalMapper;
      QVector&lt;QSpinBox*&gt; delay;
      QGridLayout *mainLayout;
  public slots:
      void selectFile(int);
      void saveFile();
      void addLineSlot();
  };
  </code></pre>
  
  <p>when i create and display SWindow object from mainWindow like this</p>
  
  <pre><code>void mainWindow::openSettings()
  {
      config = new SWindow();
      config-&gt;show();
  }
  </code></pre>
  
  <p>everything is ok, but now i need to access the mainWindow from SWindow, and</p>
  
  <pre><code>void mainWindow::openSettings()
  {
      config = new SWindow(this);
      config-&gt;show();
  }
  </code></pre>
  
  <p>doesn't display SWindow. How can i display SWindow?</p>
  
  <p>How do i call a function on widget close?</p>