[Development] qmlbundle vs Qt Resource System

Thomas Hartmann Thomas.Hartmann at digia.com
Tue Aug 13 12:40:20 CEST 2013


Hi,

we had a brainstorming session about .rcc/.qrc and qmlbundle in the 
Berlin office. I will try to sum it up from my point of view.

My conclusion would be to deprecate qmlbundle, since it is not really 
documented and supported (especially from the tooling side) and it does 
not seem to have any genuine advantage, while .qrc files and .rcc files 
have been part of Qt practically for ever and are supported by tooling.

.rcc files are a package format just like qmlbundle files They are 
independent of plugins and executables, while they can be embedded in code.
I do not know about use case where .rcc files should not be able to take 
the place of qmlbundle.

We might want to allow wild cards in .qrc files and make rcc more 
flexible so it becomes easier to package complete directories of .qml 
resources or plugins, but this is no show stopper and can be fixed in Qt 
5.2.

The only use case that came up, where .rcc should not be the solution, 
is a cache for the jit. I think any cache for the jit should go into a 
separate file and should not get mixed up with resource bundling.

Another topic that came up was qmldir. Since Qt 5 now supports to .json
to describe and annotate a plugin, shouldn't we use this instead of 
another arbitrary file format? Of course we will continue support for 
qmldir, but we should depreciate it and use .json instead. Like for any 
other plugin in Qt.

The qmldir file could be replaced by qmldir.json in the pure .qml plugin 
case.

If the plugin is converted to .rcc the .rcc file contains the 
qmldir.json file.

If anybody knows of any reason/use case to keep qmlbundle please speak up.


Am 08/08/2013 09:25, schrieb Koehne Kai:
> - both rcc and qmlbundle can be used to bundle resource files (.qml, .js, images ...)

True.

> - qrc resources can be stored in separate files (.rcc), or embedded into the executable. Qmlbundle files are always separate files (.bundle).

True. While most people (including me) did not know about .rcc files, 
they are supported.

> - rcc can optionally compress the content (on by default).

If it does not already do this: rcc should not compress kwown image 
compressed formats by default (.jpg/.png).

> - qrc/rcc is neatly integrated into qmake/cmake/qbs for the embedded case. There's no direct support for qmlbundle in any build system (yet).

Yes.

> - rcc always processes a .qrc file, while qmlbundle individually add / remove /update files to a bundle by passing them on the command line.

There was the idea to add similar functionality to rcc. Like any command 
line compression tool rcc then would take files and even (recursive) 
directories and convert them to .rcc files.

> - qmlbundle has 'metalinks' that you can use e.g. store stripped / processed versions of individual files.

Is this used? Couldn't this be solved by file endings instead?

> - Rcc has file aliases and location language selectors.

Especially the language selectors are a concept that this already used.

> - qmlbundle is tightly integrated into QtDeclarative, e.g. a 'qmldir' file can actually be a bundle .

Yes, but in my eyes this does not justify another format.


Kind Regards,
Thomas Hartmann



More information about the Development mailing list