I have a special problem, I think, so I would like to ask help from someone who is well up in qt.

The situation is: there is a dll file, called myprog.dll . I would like to use it from an another program, called callerprog.

In myprog.dll there are threads and some standalone static objects. The standalone objects and some objects in the threads are communicating by the help of connects.

I call some functions defined in the dll.
But: in the dll it is QApplication needed because of starting event handling.
So I make a static QApplication variable, and call its exec() function. But QApplication is a main event loop and it waits until exit(), so collerprog can't make anything until QApplication's exit()/quit().

I would like to run some functions in the dll, but I wouldn't like to wait for its end. E.g. a good work maybe:

...
[callerprog: ] functionInDll();
[mydll: ] start working, start event handling
[callerprog: ] dosomething();
..
[callerprog: ] getTheSolutionFromTheDll();


What can be a good method for the above?
I think QApplication not. But what else, which can satisfy the event handling condition?


Thank you very well for the answers.