Reputation: 117
I have a Qt main application which dynamically loads DLLs with a C API. I can't use Qt plugins, since a few DLLs are pure C.
Now I want the possibility for a DLL to make the main Qt application open a window, decorate it and add a QWidget provided by the DLL.
I'm afraid that if I just push it through as a void* and add it as a QWidget, the main application will try to free it when the window closes which would probably result in undefined behaviour.
Upvotes: 2
Views: 340
Reputation:
The main issue is whether the main application links to Qt dynamically or statically. If dynamically, that resolves the issue of static data sharing (since it will mostly reside in the DLL).
Without more details, I'd just say "try it" and see what breaks.
Upvotes: 1