gpt4 book ai didi

c++ - 在 Windows 上部署 QML 应用程序的正确方法

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:27:38 25 4
gpt4 key购买 nike

最近我需要为我的 Qt-QML 应用程序创建一个部署包。这个过程非常繁琐,因为您需要手动查找和复制依赖项。如(官方?)Qt Wiki 中所述:

Copy the following into C:\Deployment\

- The release version of MyApp.exe
- All the .dll files from C:\Qt\5.2.1\mingw48_32\bin\
- All the folders from C:\Qt\5.2.1\mingw48_32\plugins\ (If you used QML)
- All the folders from C:\Qt\5.2.1\mingw48_32\qml\

Do the deletion steps below in C:\Deployment\ and all of its subdirectories.
After each deletion, launch C:\Deployment\MyApp.exe and test it.
If it stops working, restore the files you just deleted.

- Launch MyApp.exe. While it is running, try to delete all DLLs.
The DLLs that aren't used will go to the recycle bin,
leaving behind only the DLLs that you need.
(This trick doesn't work for .qml and qmldir files, however).
- (If you used QML) Delete a few .qml files and try relaunching MyApp.exe.
Repeat until you try all .qml files.
- (If you used QML) Delete qmldir files from the folders that have no more DLLs or .qml files

对于任何现代工具来说,这样的过程看起来都非常荒谬。是的,我知道 windeployqt.exe,但它找不到所有 .dll 依赖项,对 .qml 也没有任何帮助依赖关系。

有没有人知道解决这个问题的更实际的方法,人们如何在大型项目中处理这个问题?有什么工具可以提供帮助吗?

Qt 开发人员是否计划对此做些什么?

最佳答案

对于 windeployqt,有选项 --qmldir

windeployqt --qmldir f:\myApp\sources f:\build-myApp\myApp.exe

因此它也检查导入并获取 qml dll。

所有这些都在 linked article 中进行了描述

关于c++ - 在 Windows 上部署 QML 应用程序的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35195687/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com