Clashing paths of Qt resources in multiple shared libraries
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.
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.
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.
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