Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Clashing paths of Qt resources in multiple shared libraries

    General and Desktop
    2
    4
    1201
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chris Kawa
      Chris Kawa Moderators last edited by

      Hi,

      I've got this project that loads plugins from shared libraries.
      All of the plugins and the main app are based on a common framework that holds a configuration file (version info etc.) in a .qrc resource. This configuration file has a path like ":/res/config.ini"

      On app load and on each plugin load they're suppose to read their configuration from those files.
      Main app loads correct configuration, but plugins seem to catch the main app file instead of their own copy.

      I assume the resources are loaded to a "common space" and there's path clashing.
      I know it's desirable in general but in my case this is a problem.
      Is there a way to separate Qt resources so that dynamically loaded shared library "sees" only it's own resources and not the common pool?
      Prefixing etc. is not an option because as I said - they're based on a common framework and the paths are fixed.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        It would need some sort of namespacing but I don't think it's available for qrc

        I wonder if this might be seen like a bug or a feature request.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • Chris Kawa
          Chris Kawa Moderators last edited by

          I ended up switching to windows .rc files for some of the resources (it's a Windows only project).
          Fortunately "LoadResource":http://msdn.microsoft.com/en-us/library/windows/desktop/ms648046.aspx lets me specify a module to look in.
          It's less than ideal to have two different resourcing systems and I like qrc better, but with some wrapping around I managed to get similar interface for my needs.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            I agree, a pure qrc solution would be better.

            Did you look at the bug tracker to see if there was something related to this ? Otherwise It could be a new feature of qrc

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post