title: Must construct a QApplication before a QWidget & Invalid parameter passed to C runtime function
body: <p>I finished migrating an application from Qt4 to Qt5, it compiles and everything but it crashes at a certain point. I am debugging it and trying to find why but I have reached a dead end:</p>
  
  <p>Here is the stack:</p>
  
  <p><img src="https://i.stack.imgur.com/ApNnI.png" alt="enter image description here"></p>
  
  <p>main.cpp line 373:<p></p>
  
  <pre><code>TouchSwibz w(NULL, NULL, renderMode ? renderMode : AppSettings::RASTERMODE);
  </code></pre>
  
  <p>When it reaches the breakpoint and I try to go further, it crashes with the usual </p>
  
  <blockquote>
    <p>"This application has requested the Runtime to terminate it in an
    unusual way."</p>
  </blockquote>
  
  <p>And the aplication output shows</p>
  
  <pre><code>QWidget: Must construct a QApplication before a QWidget
  Invalid parameter passed to C runtime function.
  Invalid parameter passed to C runtime function.
  </code></pre>
  
  <p>I have thought maybe its because the widget is being initialized when the main window is being created, but what can be done to solve this? What would be a good workaround? I dont even know if this is the real issue.
  I work under Windows 7 x64 using Qt 5.2.1 and compiling with mingw 4.8 32bit, the application is in 32bits also. Everything is compiled with the same kit.
  I dont know what other useful information I can provide. I tried stepping inside the QwtSlider constructor but I cant.</p>