Unsolved Add QML file NOT in resource file. How?
-
Hello!
I've got forgotten how to add QML file into *.pro file directly without resources. I remember only this - there are need to be added something special that will deploy QML files to the distribution folder. Could someone refresh my memory?
For now I am adding it through Qt Creator interface, but it's not deploying on device when building it.
What am I missing?
-
-
-
@bogong It says in the documentation, thats its for UnixMake specs only, I assume thats the issue 🤔
I don't know, the other idea I have would be a QMake_POST_LINK export, that copies all files after compilation
-
-
In order to copy files we have a build step like this:
templates.path = $$INSTALL_BASE templates.files = \ ../file.txt \ ../file2.txt INSTALLS += templates
You will have to figure out the correct paths though. I believe "templates" is a name you can choose.
-
@fcarney It's not working. Still ignoring copying files totally.
-
defineTest(copyToDestDir) { files = $$1 dir = $$2 # replace slashes in destination path for Windows win32:dir ~= s,/,\\,g for(file, files) { # replace slashes in source path for Windows win32:file ~= s,/,\\,g QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$shell_quote($$file) $$shell_quote($$dir) $$escape_expand(\\n\\t) } export(QMAKE_POST_LINK) } copyToDestDir(sourceFolder, destination)
-
@J-Hilk Everything ignored on MacOS. I really don't know what is going on. It's DO NOT copying any files. I just need to add *.qml files to the project without resource files, directly. Nothing more.