title: Qt: mainWindow->show(); does not show the mainWindow
body: <p>In the code below, I create a window, invoke <code>window.show()</code>, but the window doesn't show up until after <code>window-&gt;iterateSolution()</code> is called. Almost as if, <code>app.exec()</code> is the function that shows the window. I'm very new to Qt so I have no idea what is going on.</p>
  
  <pre><code>#include &lt;QtGui/QApplication&gt;
  #include &lt;mainWindow.h&gt;
  #include &lt;Cube.h&gt;
  
  mainWindow * newWindow;
  
  int main(int argc, char *argv[]) {
      // initialize resources, if needed
      // Q_INIT_RESOURCE(resfile);
  
      QApplication app(argc, argv);
      newWindow = new mainWindow;
      newWindow-&gt;show();
  
      QString initialState = "YWOBYYBYYGRRGRRBWWYOOYGGRGGBBGYOOYOOWRRBBRBBWGOOGWWRWW";
  
      /* Construct cube, set state, and solve */
      Cube * cube = new Cube(initialState);
      QString solution = cube-&gt;solve();
      delete cube;
      newWindow-&gt;iterateSolution(solution);
  
      // create and show your widgets here
  
      return app.exec();
  }
  </code></pre>