My company is considering a jump from Qt 4.8.4 to Qt 5.4, but I came across a change that may be indicative of us: it QMetaType::unregisterType()is being deleted ( http://doc.qt.io/qt-5/sourcebreaks.html ).
Our GUI requires plugins to load at runtime, with the same plugin potentially loading and unloading more than once during a GUI session. In Qt 4, we ran into a problem when, when loading the plugin a second time, any signal / slot that used one of the custom types registered by the plug-in would cause access violations, since the meta-type registered the first instance of the plug-in (which was now unloaded , so the memory space was invalid). We worked on this issue by defining our own macros to safely register and unregister meta types when the plugin was loaded and unloaded.
If it is QMetaType::unregisterType()no longer present, I am afraid that this problem will return without a real way to solve the problem. Upgrading to Qt 5.4 would be a significant investment to even get to the point that I could test this problem, so I hope I can get some guidance from experts here.
Is there a way to unregister a meta type in Qt 5? If not, now Qt 5 has some kind of system that can detect when the DLL is unloaded and unregister the meta types themselves (I hardly guess)? Alternatively, if we switch to the new Qt 5 signal / slot syntax, does this completely free us from the need for meta types? If so, does the new queue syntax add to the queue? Please forgive my ignorance on this issue, but I do not see it being explicitly indicated as supported or not.
source
share