[Interest] Qml .rcc by module?

Jérôme Godbout jerome at bodycad.com
Wed Jun 3 00:10:58 CEST 2015


Yeah, it would be nice, if I push the idea even further, you could have
your qml inside ressource too (.qml files inside the .rcc files), that
would also be nice. Mostly the external are not qml scripts but images,
movies and other files that the Qml will be usings.

The problems we are facing is more to load the .rcc file only when the qml
module start being used.

Wonder if there's a way to have a callback on the QQmlEngine to known when
it will load a new module (or all module for that matter could do the job
with it's path).

Anybody have information on the QQmlEngine::addNamedBundle() function doc
does not say anything? What is namedBundle exactly?

Thanks,
Jerome


On Tue, Jun 2, 2015 at 5:03 PM, md at rpzdesign.com <md at rpzdesign.com> wrote:

> Gerome:
>
> Hopefully I understand what you mean.
>
> Looks like you are trying to load externalized QML resources dynamically.
>
> QML Dynamic options:
>
> Loader->Source()  (Url or Localfile)
> Loader->SourceComponent()
>
> Dynamic C++:
> QmlEngine->loadData()/load()
> QmlComponent->setData()/loadUrl()
>
> I have yet to see anyone comment on how to load "IMPORTABLE" QML
> components dynamically.
>
> md
>
> On 6/2/2015 1:44 PM, Jérôme Godbout wrote:
> > Hi,
> > It may seem odd, but I'm looking to have some resources bundle that
> > could be generated for some qml modules and only used when the module is
> > used or import.
> >
> > Here's what I'm looking to do:
> >
> >   * App.exe --performAction1
> >       o ModuleA 1.0 (qmldir, some .qml)
> >           + ModuleA.rcc (images, font, video, txt, .html, etc related)
> >       o ModuleB 1.0
> >           + ModuleB.rcc
> >   * App.exe --performAction2
> >       o ModuleC 1.0
> >           + ModuleC.rcc
> >       o ModuleA 1.0
> >           + ModuleA.rcc
> >
> > I'm wondering if there's a hook that could be used to call
> > QResource::registerResource() when the module is load or a qmldir
> > syntaxe that could point the resource file to incorporated (feature
> > request if that make sense).
> >
> > qmldir file:
> > module ModuleA
> > itemA 1.0 itemA.qml
> > resource ModuleA.rcc "maproot"
> >
> > We have a single application that load very different script upon
> > launching, using a bunch of different modules, we would like to avoid to
> > load resource and require them to perform a strip down version for a
> > particular task.
> >
> > Releasing
> >
> >   * App.exe
> >   * PerformAction1.bat (calling App.exe --performAction1)
> >   * ModuleA (qml, .rcc)
> >   * ModuleB (qml, .rcc)
> >
> > Let's say performAction1 launch a script into ModuleA, which require
> > ModuleB (depends on inside qmldir could make us known all modules that
> > must be deployed or create a import walker into module to auto detect
> > all imported modules that must be deployed along). But the only show
> > stopper, is how to load the proper .rcc when module is used.
> >
> > Is loading all resource (.rcc) available to application the only option?
> > Maybe put resource inside application folder and load them all, upon
> > installing other features, it add more resources to that folder. But
> > that mean an application would load them all upon launch.
> >
> > Anybody try something like this?
> >
> > Thanks,
> > Jerome
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
>
> --
> No spell checkers were harmed during the creation of this message.
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150602/dec7f870/attachment.html>


More information about the Interest mailing list