Symbian-Developers

The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Qt Application Development => Topic started by: huellif on August 20, 2013, 04:10:33 pm

Title: Qt/QML+ QRC trick to hide files from .sis
Post by: huellif on August 20, 2013, 04:10:33 pm
Most of you use QRC to hide your code, graphics etc. in .exe file.

the usual way is put "#" in front of the files path in QML/graphics folder before build, but this does hide the files also from QtCreator.
I guess you want to show the files in QtCreator always +  hide them always from .sis, so what to do?

check e.g. this .pro file:
Code: [Select]
folder_01.source = qml/Gmail
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01

most of you do this before of an build:
Code: [Select]

#folder_01.source = qml/Gmail
#folder_01.target = qml
#DEPLOYMENTFOLDERS = folder_01

simply remove all this lines and add:

Code: [Select]
#hack to hide QML and .js from  build, but show them in QtCreator + for lupdate
{ SOURCES += qml\Gmail\*.qml } \
{ SOURCES += qml\Gmail\js\*.js } \

works fine or?

QtCreator does ignore the { } and shows the files, build qmake and sisbuild don't include the files.

another feature:
if you want to make a multilanguage app you can run:
Code: [Select]
lupdate Projectname.pro -ts translation.ts

to create a single .ts file which contains ALL QML strings for QtLinguist
Title: Re: Qt/QML+ QRC trick to hide files from .sis
Post by: mk27 on August 20, 2013, 04:21:22 pm
Nice trick! Exactly what I needed! ;) Thanks! +1 Rep. added.
Title: Re: Qt/QML+ QRC trick to hide files from .sis
Post by: huellif on August 20, 2013, 04:23:49 pm
;)

do you already know how QRC works?
check here:
http://sdf.allstarsoftware.co.uk/qt-application-development/how-to-qt-splashscreen-for-qml-apps/?action=dlattach;attach=13814
Title: Re: Qt/QML+ QRC trick to hide files from .sis
Post by: pisarz1958 on August 20, 2013, 07:32:40 pm
Putting this stuff in "SOURCES" breaks compilation for Harmattan platform, so I suggest using simply "OTHER_FILES", though it isn't working properly with lupdate, so you still need to use this simple hack to get lupdate to work.

huellif, could you someday explain internationalization in QtQuick? I was able to generate .ts file, but I have no idea, what should I do with it after that, not counting putting translations in this file. They simply weren't loaded.
Title: Re: Qt/QML+ QRC trick to hide files from .sis
Post by: huellif on August 20, 2013, 10:01:40 pm
it's not really hard.
If you want to I can create a multilanguage hello world for this section.

In DelightApp (app for our CFWs) I implemented it successfully based on Dicksons Tweetian code.


You have to compile the .ts file via lrelease, include them in .sis or .exe
and in main.cpp you have to load them
Title: Re: Qt/QML+ QRC trick to hide files from .sis
Post by: mk27 on September 30, 2013, 08:42:19 pm
Today I finally Used this Trick! And It Helped A lot :) Thanks again for Posting :)