Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.1.0
-
None
-
Windows 7
Description
I run into an issue trying to build my project including an executable and custom qt designer plugins in RelWithDebInfo (Release with debug information).
The shared library was correctly loaded (via QLibrary or QPluginLoader) but when trying to load the UI file containing a custom widget contained in the designer plugin, it couldn't load it and was replace by a standard widget and crash.
“QFormBuilder was unable to create a custom widget of the class 'XXX' ; defaulting to base class 'QWidget'.”
After long time debugging the problem, I realise that the plugins and the executable was not in exactly the same build type even my CMakeList.txt was hardcoding the buildtype to RelWithDebInfo. Using the environment variable QT_DEBUG_PLUGINS it appears that the plugin was still in debug somehow even compiled using RelWithDebInfo.
We finally fix the problem by adding this line in the file Qt5CoreMacros.cmake :
Line 247 (in Qt 5.1 release) : set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
Just after the same line with "COMPILE_DEFINITIONS_RELEASE".
Maybe this can help other to be fix in the next version if it's actually a bug.
Cheers