We developed an API in Qt, and it worked beautifully when called from another Qt application. However, whenever I tried use the API by calling it from a C# application I ran into some troubles. I noticed the API functions that used helper threads were not working when I called them from the C# application. Whenever I started debugging this on the API side I realized the following error was occurring “QEventLoop: Cannot be used without QApplication”. This error occurs for each helper thread that the API spawns with the end result being the threads don’t appear to be doing anything.

I did some research on this and I realize the problem being that QEventLoop needs to be called from an instance of QApplication which in my limited QT experience resides in main.cpp.

So with all that being said, I am left with the impression that the API in its current state is only going to be compatible with QT applications, and if I needed it to be compatible with anything else we are going to have reimplement the threading on the API side.

Is my conclusion correct? From what I understand that QApplication can only be called in the main loop of an application and not in an initialization routine in an API function. Does anyone have any suggestions and/or workarounds for this issue?