[Qt-interest] QML compilation ?

Sean Harmer sean.harmer at maps-technology.com
Mon Jul 19 11:56:29 CEST 2010


On Monday 19 July 2010 10:38:48 Stephen Collyer wrote:
> All of the QML examples that I've seen deliver a text-based .qml
> file, that I guess is loaded into a QDeclarativeView via
> QUrl::fromLocalFile().
> 
> However, that requires that the source code for the QML part of the app. be
> made available to anyone who wishes to see it. I can imagine this will be
> less than desirable to commercial app. developers.
> 
> Does the declarative framework provide any support for the delivery
> of an internally compiled form of a .qml file ? What is the recommended
> approach for QML development for those who don't want to make the
> source available ?

My first thought is to add it to your application's resource file and compile 
it into your app like any other resource. You can then access the qml string 
via the usual method e.g. QFile myQmlFIle( ":/path/to/my/qml/file" ).

Cheers,

Sean



More information about the Qt-interest-old mailing list