Not able to run basic example with UI in qt
-
I am trying to build a basic qt example from the following link. The example has main.cpp file and some .qml files in the folder. By default .qml files are in the folder /Resources/qml.qrc//application.qml.
When I build the program the UI loads but it is not what is expected. I can not see the UI with a rectangle with red color. Can someone help?
https://doc.qt.io/qt-5/qtquick-deployment.html
In the application output window, I see the following error
file:///user/build-untitled2-Desktop_Qt_5_12_12_GCC_64bit-Debug/application.qml: No such file or directory -
A common way to deploy QMLs is to simply store them in a QRC file. Then they will never get lost, regardless of build system settings.
-
My application is still not able to find the .qml files.! here is a screenshot of what I have in the project.
I have the following in the .pro file of my project
SOURCES +=
main.cppRESOURCES +=
resource.qrcDISTFILES +=
SquareButton.qml
myapplication.qml
main.qmlThe last thing is that from my main.cpp I do something like the following, but the files are not found.
view.setSource(QUrl::fromLocalFile("qrc:/main.qml"));