I would like to use the Qt GUI library as the user interface for a VST plugin. A VST plugin is a DLL on windows. A host application calls various functions on the DLL, including things like openGUI()
.
I want to know how to use Qt GUI from a DLL; I have done some research to look at the possible options but I'm not completely sure on the limitations.
The main problem is where to create the QApplication
object and call exec()
on it (which is a function that does not return until the application has quit).
I have looked at the solution given in this post, but after further reading it would appear this solution will not work on Mac OS X, as Cocoa is more restrictive about the particular thread a GUI can run on. It's a bit of a hack really.
I have also seen this solution, but that relies on QMfcApp
and QWinWindow
which don't appear to be part of the Qt library any more.
Is the only way round this for my DLL to spawn off a new application itself? Presumably I could start one with a call to QProcess
and use some shared memory to share between the GUI application and my VST DLL? Has anyone come across this type of problem? Am I going down a bad route with this or is there something I haven't thought of yet?
Update
After further research I have come across the QAbstractEventDispatcher
class. I have seen this post which seems to say it's possible to call QApplication::processEvents()
from your own (the host of my plugin) event loop instead of calling QApplication::exec()
. Has anyone tried doing this?