It is a minor bug of yours actually. A qml file is searching JS files by default in the same folder it is into. So that makes it the folder {project root folder}/qml/Andjsapp. But your script file is in {project root folder}. So it is logical that it can't be found.
The best solution would be to:
- go in the folder {project root folder}/qml/Andjsapp and create a new folder called "scripts"
- In there add your JS files.
- In the EditPage.qml change the import from:
Code:
import "script.js" as ShoppingListDb
to
Code:
import "scripts/script.js" as ShoppingListDb
-finally remove from the .pro file the following lines:
Code:
OTHER_FILES += \
qml/Andjsapp/EditPage.qml \
script.js
These are already handled by the qmlapplicationviewer.pri and since your .js files are now in the qml directory of the project you need to worry no more about their deployment.
Regards.