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

Fix static build of Qt resources

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.12.0
    • Core: Resource System
    • None
    • All

    Description

      Initialization of qmldir from moc in static build plugin can silently fail. The issue is in resource init function. This function name is based on project (.pro) name. When two projects have same name (very common) only one resource init function will be used for all mocced plugins.

      Example of failed/incompatible plugins:

      Q_IMPORT_PLUGIN(QtGraphicalEffectsPrivatePlugin)
      Q_IMPORT_PLUGIN(QtQuick2DialogsPrivatePlugin)
      

      In static build FileDialog in qml cannot be used -> QtQuick2DialogsPrivatePlugin uses private_plugin_resource_init function from QtGraphicalEffectsPrivatePlugin.

      Problematic files/functions:

      \qtgraphicaleffects\src\effects\private\private_plugin_resources.cpp(6):void private_plugin_resource_init() 
      \qtquickcontrols\src\dialogs\Private\private_plugin_resources.cpp(6):void private_plugin_resource_init()
      

      fix
      The issue is fixed by including unique string when generation resource files/functions: 

      \qtgraphicaleffects\src\effects\private\private_108_plugin_resources.cpp(6):void private_108_plugin_resource_init() 
      \qtquickcontrols\src\dialogs\Private\private_105_plugin_resources.cpp(6):void private_105_plugin_resource_init()
      

      caveat
      Proposed patch is still not optimal. Function str_len should be replaced with hash of project file path.

      Attachments

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

        Activity

          People

            hjk hjk
            gasper Gašper Lah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes