Regarding Qml

  • Hi all

    I have a basic doubt regarding qml. i am trying to develop my code using Qml, till now it was working fine but from yesterday, when i make small changes also i need to clean the code every time (before i was not doing this), even if small width change, i need to clean the code to update the changes in the output. if i don't clean the changes will not appear and the same previous code's output i get.
    What is the problem, can anyone suggest me the solution for this.


  • Moderators

    What have you changed in the meantime? Have you updated Qt or Qt Creator? Have you changed anything in your .pro file? Do you attach QML by filesystem path or using QRC?

  • @sierdzio

    What have you changed in the meantime?

    i have not made any changes, i just used the updated code( the code was updated in other system).

    Have you changed anything in your .pro file? Do you attach QML by filesystem path or using QRC?

    no i have not changed the .pro file. i am attaching QML by QRC.

  • Moderators

    @Naveen_D said in Regarding Qml:

    i just used the updated code( the code was updated in other system).

    Perhaps the .pro.user file from that other system was copied into yours and messed up the config? Try removing the .pro.user file, then rebuild your project.

    Otherwise I see no reason why it should suddenly stop working.

  • @sierdzio ya i did that, even changed the .pro file name and again restarted, the same issue continues

  • Moderators

    hm, no idea then, sorry :-(

  • @Naveen_D If I understood correctly your changes in .qml files aren't reflected in the application when you run it. I have run into that kind of problem under certain conditions, I don't remember what, but it was always cured by deleting the build directory and building again. Clean&rebuild isn't always enough.

  • @Eeli-K I deleted the build directory, renamed the .pro file, changed the location of that file in my system. still the same issue. don't know what else i want to do to resolve this.

  • @Naveen_D It's possible that the qml file is cached (see and there's a bug which prevents the system seeing that the file is changed. What happens if you find the cache by adding

    #include <QStandardPaths>
    #include <QDebug>
    qDebug() << QStandardPaths::standardLocations(QStandardPaths::CacheLocation);

    in your main.cpp and delete the qml cache before running but without doing clean?

  • @Naveen_D Might be silly, but did you run QMake after cleaning? I had the exact same issue, I did 'clean' and then 'build', it didn't help. I deleted the build folder, it didn't help. But then I cleaned and ran QMake and now it seems to be updating normally.

  • @Eeli-K

    #include <QStandardPaths>
    #include <QDebug>
    qDebug() << QStandardPaths::standardLocations(QStandardPaths::CacheLocation);

    i went to this path and removed the cache. Even then the changes won't reflect in the application without cleaning.

    I have tried that also running qmake and then launching the application. but didn't work.

  • @Naveen_D This sounds really strange. If you delete the build directory all will be built from scratch, it should be more efficient than clean&build, especially if cache isn't to blame.

    In the build directory there's either debug/ or release/ directory, under that there's qrc_qml.cpp (and corresponding qrc_qml.o) file. Save it and compare it with the new one after building without cleaning. Does the diff tool reveal differences? With the cleaning phase they at least should be different. (Edit: in Creator there's a diff tool under Tools.)

    If your project is closed source it's difficult to debug the problem. Otherwise you could give us a chance to test it. If the problem persists when others try it it's most probably a bug somewhere in Qt or in the build system.

    You could also try to build it manually from command line.

    BTW, you haven't told your Qt and Creator versions. It may be crucial.

Log in to reply