I\'ve created a Qt-based network library for use with applications that are not running a Qt event loop, and which are not necessarily otherwise Qt applications. This was ma
The problem arises because you're touching Qt APIs (in the main thread, or just in some thread) before creating QApplication. You can't do that. In particular, you're creating a QObject of some kind, which is setting somwhere in Qt what Qt itself should consider as the main
thread.
The only Qt APIs you're allowed to use before creating a QApplication are the ones that are explicitely documented to be safe in that scenario.
So: don't do that. Build a QCoreApplication as the first thing, then you're free to go.