Running a QML .exe file on Windows
-
You have to give the path to where your QML files are in your application sources to the
--qmldir
option. -
You have to give the path to where your QML files are in your application sources to the
--qmldir
option. -
As I already wrote: your application sources where the qml files are located.
-
wrote on 25 Apr 2019, 09:30 last edited by
Have you solved this problem?I encountered the same problem,my enviroment is msvc2017_64 + win10.
-
Have you solved this problem?I encountered the same problem,my enviroment is msvc2017_64 + win10.
@Crawl.W Did you use windeployqt tool?
-
wrote on 30 Apr 2019, 02:38 last edited by Crawl.W
@jsulm Yes,windeployqt can not deploy a executable application,I double click the exe but nothing ever happens.I answer the question on stackoverflow.com where user name is Crawl.W as here.I copy qml floder to runtime directory,and then run the exe, then fell all other unoccupied files heartily.But seemly cannot delete some unoccupied thing in qml\QtQuick, if I delete it double click the exe will have nothing happened.
-
@jsulm Yes,windeployqt can not deploy a executable application,I double click the exe but nothing ever happens.I answer the question on stackoverflow.com where user name is Crawl.W as here.I copy qml floder to runtime directory,and then run the exe, then fell all other unoccupied files heartily.But seemly cannot delete some unoccupied thing in qml\QtQuick, if I delete it double click the exe will have nothing happened.
wrote on 30 Apr 2019, 07:49 last edited by@Crawl.W
You must pass it the correct arguments not just double click the exe.
did you look at he docs here -
@kenchan My program haven't arguments need to pass. I will read your post linkage carefully and refine some answers here.
wrote on 5 May 2019, 15:00 last edited by@Crawl.W
Kenchan has mentioded the deploy tool arguments.Windeployqt does'nt know if you are deploying an qml application, so you need to pass
--qmldir [your qml root path folder]
argumentNote: if your qml root path folder has space characters, you should use double quotes between your path or it will interpret as Different Commands.
-
@Crawl.W
Kenchan has mentioded the deploy tool arguments.Windeployqt does'nt know if you are deploying an qml application, so you need to pass
--qmldir [your qml root path folder]
argumentNote: if your qml root path folder has space characters, you should use double quotes between your path or it will interpret as Different Commands.
wrote on 6 May 2019, 01:28 last edited by Crawl.W 5 Jun 2019, 01:33@KillerSmath @kenchan I found my posting linkage of stackoverflow is invalid, I update it just now, Here(https://stackoverflow.com/questions/44762836/deploying-qt-c-qml-application-on-windows/55850012#55850012). My problem seems to need some non-dynamic library(DLL), and runtime is unoccupied. Kind of weird. I had already run my program and then I wanna know that's about what.
-
@KillerSmath @kenchan I found my posting linkage of stackoverflow is invalid, I update it just now, Here(https://stackoverflow.com/questions/44762836/deploying-qt-c-qml-application-on-windows/55850012#55850012). My problem seems to need some non-dynamic library(DLL), and runtime is unoccupied. Kind of weird. I had already run my program and then I wanna know that's about what.
wrote on 6 May 2019, 01:38 last edited by KillerSmath 5 Jun 2019, 01:39@Crawl.W
If your apllication is running on test environment, so the windeployqt should able to identify and copy the dependent dlls.
Keep in mind, you also can use --force parameter to copy the dependencies even though they already exist on deploy folder. -
@Crawl.W
If your apllication is running on test environment, so the windeployqt should able to identify and copy the dependent dlls.
Keep in mind, you also can use --force parameter to copy the dependencies even though they already exist on deploy folder.wrote on 6 May 2019, 01:52 last edited by@KillerSmath I have tried
--qmldir [your qml root path folder]
, deployed program is still not work. -
@KillerSmath I have tried
--qmldir [your qml root path folder]
, deployed program is still not work.wrote on 6 May 2019, 01:56 last edited by@Crawl.W
Can you show a detailed command example ? -
@Crawl.W
Can you show a detailed command example ?wrote on 6 May 2019, 02:09 last edited by Crawl.W 5 Jun 2019, 02:10@KillerSmath
windeployqt --qmldir D:\Qt\Qt5.12.0\5.12.0\msvc2017_64\qml ImWorkStation.exe
What I can confirm now is my program need to depend on some unoccupied non-dll at runtime, which exits in qmldir. -
wrote on 6 May 2019, 02:39 last edited by KillerSmath 5 Jun 2019, 02:41
@Crawl.W
When i said [your qml root path folder], it means your project folder path where are your qml files.Example:
D:\MyProject\qml
D:\MyProjectNote: Use --force parameter if you already have old deploy files.
-
@Crawl.W
When i said [your qml root path folder], it means your project folder path where are your qml files.Example:
D:\MyProject\qml
D:\MyProjectNote: Use --force parameter if you already have old deploy files.
wrote on 6 May 2019, 06:21 last edited by Crawl.W 5 Jun 2019, 06:23@KillerSmath Good, I changed to where my project's qml file is located, it works. You rocks!
I might have three more questions:- if my project's qml file locate two folder, how I should pass directory?
- just because the qml file needs to do this?
- Always confused. What are the non-occupied dependencies at runtime but is must when startup? I am targeting two folders: QtQuick\Controls and QtQuick\Extras
-
@KillerSmath Good, I changed to where my project's qml file is located, it works. You rocks!
I might have three more questions:- if my project's qml file locate two folder, how I should pass directory?
- just because the qml file needs to do this?
- Always confused. What are the non-occupied dependencies at runtime but is must when startup? I am targeting two folders: QtQuick\Controls and QtQuick\Extras
wrote on 6 May 2019, 07:39 last edited by@Crawl.W
1- if my project's qml file locate two folder, how I should pass directory?If your project is organized as below then pass the project path because the qmlimportscanner will find all files inside the root folder.
- Project
- qml_1
- file_1.qml
- qml_2
- file_2.qml
- qml_1
2 - just because the qml file needs to do this?
https://doc.qt.io/QtQuickCompiler/#overviewAs .qml files are loaded at run-time, it is necessary to deploy them together with the released application.
3 - Always confused. What are the non-occupied dependencies at runtime but is must when startup? I am targeting two folders: QtQuick\Controls and QtQuick\Extras
Depend on which qml files are loaded.
-
@Crawl.W
1- if my project's qml file locate two folder, how I should pass directory?If your project is organized as below then pass the project path because the qmlimportscanner will find all files inside the root folder.
- Project
- qml_1
- file_1.qml
- qml_2
- file_2.qml
- qml_1
2 - just because the qml file needs to do this?
https://doc.qt.io/QtQuickCompiler/#overviewAs .qml files are loaded at run-time, it is necessary to deploy them together with the released application.
3 - Always confused. What are the non-occupied dependencies at runtime but is must when startup? I am targeting two folders: QtQuick\Controls and QtQuick\Extras
Depend on which qml files are loaded.
wrote on 6 May 2019, 10:01 last edited by Crawl.W 5 Jun 2019, 10:02I think this is the final answer to this question.Thanks to @KillerSmath 's for your patience. Thanks also to kenchan.
By the way, last question(with a sly grin),what windeployqt provides is not all necessary, how deploy by the best concise? - Project
-
I think this is the final answer to this question.Thanks to @KillerSmath 's for your patience. Thanks also to kenchan.
By the way, last question(with a sly grin),what windeployqt provides is not all necessary, how deploy by the best concise?wrote on 6 May 2019, 10:36 last edited by ODБOï 5 Jun 2019, 10:37hi
@Crawl.W said in Running a QML .exe file on Windows:all necessary
1 start your app
2 select all the dlls
3 delete them
Only unused dlls will be deleted -
hi
@Crawl.W said in Running a QML .exe file on Windows:all necessary
1 start your app
2 select all the dlls
3 delete them
Only unused dlls will be deletedwrote on 7 May 2019, 01:15 last edited by@LeLev Yeah,that's my solution, but it will delete qml file when load at JIT. I wanna know a one-step solution.