From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.

Rebuild QML files when running

  • Hi everybody,

    I'm working in a little Qt Quick example, and I have two qml files:

    main.qml - Where I have a Windows element and a component defined in an external file (MyComponent.qml)

    MyComponent.qml - Where I define my component (it's just a Rectangle with a Text and another Rectangle inside)

    Both of them are added into qml.qrc file in "/" path (the qml.qrc file is added as RESOURCE in the .pro file)

    Well, the problem is that when I make changes in MyComponent.qml and press "Run" or "Build Project", the changes are left out in the running program, I need to "Rebuild" to make any mínimum change in "MyComponent.qml" be considered. Why this happen?

    It's like any other qml files than main.qml are not recompilated when build or run the program.

    How can I make Qt Creator recompiles (or consider) all my qml files when Running or Building the Project?

    Thank you and sorry for my poor english.

  • Lifetime Qt Champion


    Because the qml files you have are compiled in your application when using qrc. That's why you have to build your application before you can see the changes.