Qml file not found



  • Hi,

    I have created a empty project in Qtcreator and then added one qml file into it along with one main.cpp and other .h and .cpp files.When i am trying Run it from Qtcreator everytime iam recievibg a blank window and in output message comes
    Starting C:\Users\emb-raghshu\build-TestProject-Desktop-Debug\debug\TestProject.exe...
    file:///C:/Users/emb-raghshu/build-TestProject-Desktop-Debug/app.qml: File not found
    C:\Users\emb-raghshu\build-TestProject-Desktop-Debug\debug\TestProject.exe exited with code 0"

    I know that qml file is not found by exe ..so i put app.qml in debug folder and ran exe from there the QML peice of code was running fine but again if i try running from QT creator again the same error as above i recieve.

    Pleasw help me out
    Thanks


  • Moderators

    You can put the QML into a resource file (QRC), so that it is always being bundled together with the .exe. Or use a path that is relative (something like "../app.qml" should work in your case).



  • The C:/Users/emb-raghshu/build-TestProject-Desktop-Debug is your working directory.

    Your app is looking for the qml file in the working directory. But if you start the program the qml file ist still in your source directory.

    So place the qml file in the working directory or change the working directory in the project settings so that it points to the source directory.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.