There is one GUI application (host) and one plugin application. I need to run some code from plugin in the main thread of host application. I also have no access to the source code of host application. On Mac it's possible via performSelectorOnMainThread. On Win we can set a hook and then send a message. But what about Linux?
Long story:
Host application can use plugin by the two ways: directly in the main thread (via click button) and in some processes in another thread. Plugin is the Qt-based application and qApp always have to be created in the main thread (to avoid some problems), but it doesn't happen in the second case. On Win and Mac this issue is already solved through invoking creation code in the main thread (as I've written above). I'm looking for the similar way to do that on Linux.
Upd. Finally I found solution of this problem via host API. Unfortunately there is no strong guarantee, because implementation maybe different for another host (despite documentation). But for main cases it works well. Question is still actual, btw.