Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32403

Qt Designer Plugins not load properly when using RelWithDebInfo and CMake build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.1.1
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      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

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              stephen.kelly Stephen Kelly (Unused account) (Inactive)
              Reporter:
              johnlamericain Jonathan Courtois
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes