I have created 2 projects(one using visual studio 2013) and another using QtCreator for testing third party library. (Both projects have only 3 files. A.h, A.cpp and main.cpp) A is derived from QObject and has another object which is derived from QThread.
Its small QT application. I am using visual studio 2013, QT 5.6.0
//-------------------------------
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
A a1;
a1.Start();
return a.exec();
}
Class "A" in turn creates another thread class object derived from QThread. Strange thing is when I run this project in Visual studio it works fine.
But when I run same using Qt Creator 4.2.1(based on qt 5.8.0 MSVC2015 32 bit) I get following error when thread run() method is called
QEventLoop: Cannot be used without QApplication
I searched many forums but mostly all are pointing towards missing QApplication a(argc, argv);
But In my case thats not issue. Basically project works fine using visual studio but not QtCreator. Somehow when I run this project using qtCreator QThread object is not aware of QApplication existence
Note : they are 2 different project folders having same set of files. QT project settings are mentioned in .pro file whereas visual studio project settings are done using properties Page.
Could someone please help me to solve this problem