I have downloaded the Qt5.4 binaries for mingw and realizing that QtCreator is built using Visual studio, I downloaded the QtCreator sources and built it using the Qt5.4 mingw, so now I have a Qt Creator built using mingw. I tried the analog clock custom widget plugin example included with Qt5.4 examples, I built it and copied both the dll and lib.a into both folders for QtCreator built with mingw and the Qt5.4 plugins.
The analog clock appears in the left hand side along with the standard widgets and I am able to drag it into the main form, The project build fine, but When I try to run it, I get the following error:

QWidget: Must construct a QApplication before a QWidget
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.

Any idea what possibly have I done wrong?