[Interest] setMainQmlFile technique to avoid the need to copy QML files

VStevenP vstevenpavao at yahoo.com
Wed Dec 26 17:08:37 CET 2012


Hi Kohne,


----- Original Message -----
> From: Koehne Kai <Kai.Koehne at digia.com>
> Sent: Saturday, December 22, 2012 2:58 PM
> Subject: RE: [Interest] setMainQmlFile technique to avoid the need to copy QML files
 
>>  Basically, I prefix the relative path to the main QML file with the name of 

> the my app root directory, preceded by ../


> Actually a somewhat more clean hack that you can use is to hardcode the absolute 
> path. You can achieve this pretty e.g. adding to your .pro file:
> 
> DEFINES += QMLDIR=$$PWD/qml
> 
> and then use setMainQmlFile(QMLDIR/main.qml)


Thanks for describing that technique.

I just discovered I don't really _need_ to do either "hack".


The default Qt Quick 2 Application template in Qt Creator 2.6.1 (based on Qt 5.0.0 final) is taking care of copying the qml for me, just fine.  For some reason, this hadn't been working for me in the 5.0 Beta, but it's working fine in 5.0.0 final.

- VStevenP



More information about the Interest mailing list