Unsolved QtRO in non-qt dynamic library
-
@Vouk said in QtRO in non-qt dynamic library:
Is there a way to create a QCoreApplication incl. the event-loop running in a dynamic library
Why do you want to do this in the library? You do that in the application which uses the library.
-
@jsulm said in QtRO in non-qt dynamic library:
Why do you want to do this in the library? You do that in the application which uses the library.
Because I don't have access to the application that uses that dynamic library (the plugin).
([DaVinci Resolve.exe] <--> [Plugin.dll]) <--> ([Qt App.exe]) 1 2 3
- 1 is the non-qt host application (actually it uses Qt 5.4.1 but I don't want any dependency to it as other host applications i.e. Adobe Premiere do not use Qt)
- 2 The plugin is developed by me and is being loaded by the host application and running in it process.
- 3 The Qt application (maybe a service/daemon) is also developed by me and does all the work. I just need the plugin (2) to create some standard interface between (1) and (3). Previousely (3) was a COM server and (2) used it as a COM client. But that was working on windows only.
The question is: What do I need to do to get Remote Objects between (2) and (3) working? As both of them are separate processes we need some kind of IPC. Is it possible to somehow "inject" the Qt event loop stuff into it so I can get Remote Objects working? Or maybe there is another way?
-
Hi,
Did you already saw this stack overflow answer about a Qt application started from a .dll ?
-
Well, unfortunately this seems only to be working with calling regular methods. What I get this when start using the Remote Object:
QWinEventNotifier: Can only be used with threads started with QThread
-
Can you share the code you are using ?
-
Sorry, the example from StackOverflow is working for windows only. So it won't be sufficient. I'd really like to go with Win, Mac and Linux (dll, dylib and so).
That brings me back to the beginning: I have a shared library project with no Qt in it and exporting the function "helloWorld()". This shared library would be the remote objects source and in that function i'd like to (i.e.) trigger the timer of the QtRO example here: https://doc.qt.io/qt-5/remoteobjects-example-static-source.html
The thing is I am not in any QThread, it'll be a random C function in that library where I'd like to trigger the remote objects the communicates with that Qt app running.
Or very basic: How can a non-Qt library in one process communicate with a Qt app in another process?
Or do I have to go outside Qt? Like boost::ipc in both components or similar?
-
For macOS, this could be a starting point.
Before going further, what will you be sending from DaVinci Resolve to your own application ?
-
It took a while but I think I've found a nice way with a lightweight RESTful client / server approach using the loopback device. According to my tests it can handle up to 10000 requests / sec. To handle the big uncompressed UHD video frames (~66 MBytes) I use boost's shared_memory_object. It seems to be working so far with a reasonable performance.
This way I don't have to somehow force/hack Qt into native dynamic libaries.
-
ZeroMQ might also be of interest depending on the protocol you need.
-
It's an interesting project. Unfortunately Windows 10 support is bugged and the project is GPL. I'd require LGPL at least.
-
For the licensing, you are wrong. It's currently LGPL v3 plus a static linking exception and they are moving to MPLv2.
See their wiki
-
I'll wait until Win10 support is fixed and IPC works also without unix domain sockets. But besides that issues it looks promising.