Creating directory and subdirectory structure for qml and C++ files
-
wrote on 23 Dec 2016, 08:07 last edited by
Hello friends,
I am trying to put my qml files into qml folder such that it becomes:
qml/main.qml, qml/Page1.qml and qml/Page1Form.ui.qml.
After creating above folder with above files, I added in my .pro file:
OTHER_FILES +=
qml/*.qmland added in my .qrc (resource) file:
<RCC>
<qresource prefix="/qml">
<file>main.qml</file>
<file>Page1.qml</file>
<file>Page1Form.ui.qml</file>
</qresource>
</RCC>Yet, when I try to run it, it gives error "dependent ..\LearningFirstStepsWithQML\Page1Form.ui.qml" does not exist. It is searching for Page1Form.ui.qml in root directory of project rather than qml subdirectory.
I looked for examples code, but I find that they made similar change in .pro and .qrc file to create directory/subdirectory structure for qml files. But, obviously I am missing something to get above error.
Thanks for any helpful comment/advice,
Gopal -
Hello friends,
I am trying to put my qml files into qml folder such that it becomes:
qml/main.qml, qml/Page1.qml and qml/Page1Form.ui.qml.
After creating above folder with above files, I added in my .pro file:
OTHER_FILES +=
qml/*.qmland added in my .qrc (resource) file:
<RCC>
<qresource prefix="/qml">
<file>main.qml</file>
<file>Page1.qml</file>
<file>Page1Form.ui.qml</file>
</qresource>
</RCC>Yet, when I try to run it, it gives error "dependent ..\LearningFirstStepsWithQML\Page1Form.ui.qml" does not exist. It is searching for Page1Form.ui.qml in root directory of project rather than qml subdirectory.
I looked for examples code, but I find that they made similar change in .pro and .qrc file to create directory/subdirectory structure for qml files. But, obviously I am missing something to get above error.
Thanks for any helpful comment/advice,
Gopal@Gopal-Krishna said in Creating directory and subdirectory structure for qml and C++ files:
<RCC>
<qresource prefix="/qml">
<file>main.qml</file>
<file>Page1.qml</file>
<file>Page1Form.ui.qml</file>
</qresource>
</RCC>should be either:
<RCC> <qresource prefix="/qml"> <file alias="main.qml">qml/main.qml</file> <file alias="Page1.qml">qml/Page1.qml</file> <file alias="Page1Form.ui.qml">qml/Page1Form.ui.qml</file> </qresource> </RCC>
or
<RCC> <qresource prefix="/"> <file>qml/main.qml</file> <file>qml/Page1.qml</file> <file>qml/Page1Form.ui.qml</file> </qresource> </RCC>
the path between the <file> tags always needs to be relative to the qrc file.
1/2