[Interest] .rcc files and modules

Keith Gardner kreios4004 at gmail.com
Mon Jun 29 22:26:09 CEST 2015


On Mon, Jun 29, 2015 at 3:09 PM Jérôme Godbout <jerome at bodycad.com> wrote:

> Hi,
> I'm looking for a way to load a specific resources files (.rcc) when a
> modules or a plugins is used.
>
> Small example:
>
> Module A (qml module with qmldir that include plugin A)
> Plugin A (c++ implementation for some part of Module A)
> A.rcc (would be the required resources for module A made with the
> ressource compiler)
>
> I would like to register A.rcc (QResource::registerResource()) when the
> engine start loading module A or plugin A. We have many modules and not all
> them will be used. Right now, the only way is to gather all resources when
> packaging the application and the executable to load all of them uppon
> starting (which slow down boot and load many unused resources for that
> application run).
>
> We use the same executable for all applications and only the start script
> is different. We can deploy our application in plugin model (core package
> contain main lib and executable), other application just add the necessary
> modules/plugins and a startup script. But that also make the application
> have many unnecessary resources available that I would rather not load them
> all (they are already split with proper prefix to avoid name clashing).
>
> Anybody know of a way to do this? Any signal sent somwhere (looked at
> QJSEngine, QQmlEngine and QQmlApplicationEngine without any luck).
> Essentially I would like a signal before load a module/plugin name and
> version.
>
> The only way I see is to determine which modules/plugins are required from
> qml main script (we already have a script walker that does this for
> packaging purpose) and generate a list of used modules/plugins that need to
> load resources for a particular application. The main script come with it's
> own list of resources.
>
> Anybody have  a better way to release resources/modules/plugins?
>

I had this situation in my code. I made the registration of the .rcc file
occur when registering my QML components for the module. I got the idea
about how to do it from QtQuick.Controls plugin code (
http://code.woboq.org/qt5/qtquickcontrols/src/controls/plugin.cpp.html).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150629/3ba06e6d/attachment.html>


More information about the Interest mailing list