PDA

View Full Version : QT must clean project to rebuild QML file changes



xman_ss
22nd November 2011, 04:27
Hi all,

I've faced a problem:
I write code in a project with QML file. When I change the QML file, the changes does not effect to the project when I press Run. And I have to "Clean" the project and rebuild, it takes time.

Anyone who have experience, could you show me the solution, many thanks for you :)

duc_bkav
23rd November 2011, 10:23
I think this link below is helpful for you, check it man
http://zchydem.enume.net/2011/08/04/tip-of-the-day-make-qt-creator-to-compile-qml-files-to-resource-file-on-every-build/

MarekR22
23rd November 2011, 14:17
I think better solution is to store QML files as regular files not in Qt resurces (Qt resurces makes file part of binary file).

xman_ss
24th November 2011, 04:25
I think this link below is helpful for you, check it man
http://zchydem.enume.net/2011/08/04/tip-of-the-day-make-qt-creator-to-compile-qml-files-to-resource-file-on-every-build/

Thanks duc_bkav,

I follow the instruction in your link, but it does not work, even if I manually run the command "touch quickflickr.png" before building the project :(.

Added after 4 minutes:


I think better solution is to store QML files as regular files not in Qt resurces (Qt resurces makes file part of binary file).

Thanks MarekR22, I found this solution solved the problem.

My code is



QDeclarativeView view3;
view3.setSource(QUrl::fromLocalFile("UI/testWithQML.qml"));
view3.show();


In my code, I use QUrl::fromLocalFile instead of using resource.
With this solution, I have to copy qml files to the destionation directory by add some command in build steps :)