title: Qt Gui Unit Test: Must construct a QApplication before a QPaintDevice
body: <p>I managed to write a "Gui Unit Test" using <a href="http://qt-project.org/doc/qt-4.8/qtestlib-tutorial3.html" rel="nofollow">this tutorial</a>. However, when I compile my code I get this:</p>
  
  <pre><code>PASS   : testUnits::initTestCase()
  PASS   : testUnits::toUpper()
  QFATAL : testUnits::testGui() QWidget: Must construct a QApplication before a QPaintDevice
  FAIL!  : testUnits::testGui() Received a fatal error.
  Unknown file(0) : failure location
  Totals: 2 passed, 1 failed, 0 skipped
  ********* Finished testing of testUnits *********
  </code></pre>
  
  <p>why is it giving me: Must construct a QApplication before a QPaintDevice ?</p>