英文可以的同学建议直接看Qt for Windows - Deployment

简述

本文介绍了Qt在Windows上的部署过程。

Windows 部署工具

windeployqt是一个用于将Qt部署到Windows的小工具。这个工具可以在 QTDIR/bin/windeployqt下面找到。它需要在命令行环境下使用。

windeployqt以一个.exe或者一个含有.exe的文件夹作为参数。它会扫描可执行文件以寻找这个可执行文件的依赖。如果使用–qmldir选项传递目录,windeployqt会使用qmlimportscanner工具来扫描文件夹中的QML文件以获取QML导入的依赖。被扫描出来的依赖将会被复制到这个可执行文件夹中。

对于Windows桌面应用程序,编译器所需要的运行时文件也会被复制到部署文件夹中。

有时候应用程序可能会需要额外的第三方库(例如,数据库相关的库),这些库不会被windeployqt添加,需要手动添加。

更多关于windeployqt的信息如下:

Usage: windeployqt [options] [files]
Qt Deploy Tool 5.12.2The simplest way to use windeployqt is to add the bin directory of your Qt
installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:windeployqt <path-to-app-binary>
If ICU, ANGLE, etc. are not in the bin directory, they need to be in the PATH
variable. If your application uses Qt Quick, run:windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>Options:-?, -h, --help            Displays this help.-v, --version             Displays version information.--dir <directory>         Use directory instead of binary directory.--libdir <path>           Copy libraries to path.--plugindir <path>        Copy plugins to path.--debug                   Assume debug binaries.--release                 Assume release binaries.--pdb                     Deploy .pdb files (MSVC).--force                   Force updating files.--dry-run                 Simulation mode. Behave normally, but do notcopy/update any files.--no-patchqt              Do not patch the Qt5Core library.--no-plugins              Skip plugin deployment.--no-libraries            Skip library deployment.--qmldir <directory>      Scan for QML-imports starting from directory.--qmlimport <directory>   Add the given path to the QML module search locations.--no-quick-import         Skip deployment of Qt Quick imports.--no-translations         Skip deployment of translations.--no-system-d3d-compiler  Skip deployment of the system D3D compiler.--compiler-runtime        Deploy compiler runtime (Desktop only).--no-compiler-runtime     Do not deploy compiler runtime (Desktop only).--webkit2                 Deployment of WebKit2 (web process).--no-webkit2              Skip deployment of WebKit2.--json                    Print to stdout in JSON format.--angle                   Force deployment of ANGLE.--no-angle                Disable deployment of ANGLE.--no-opengl-sw            Do not deploy the software rasterizer library.--list <option>           Print only the names of the files copied.Available options:source:   absolute path of the source filestarget:   absolute path of the target filesrelative: paths of the target files, relativeto the target directorymapping:  outputs the source and the relativetarget, suitable for use within anAppx mapping file--verbose <level>         Verbose level (0-2).Qt libraries can be added by passing their name (-xml) or removed by passing
the name prepended by --no- (--no-xml). Available libraries:
bluetooth concurrent core declarative designer designercomponents enginio
gamepad gui qthelp multimedia multimediawidgets multimediaquick network nfc
opengl positioning printsupport qml qmltooling quick quickparticles quickwidgets
script scripttools sensors serialport sql svg test webkit webkitwidgets
websockets widgets winextras xml xmlpatterns webenginecore webengine
webenginewidgets 3dcore 3drenderer 3dquick 3dquickrenderer 3dinput 3danimation
3dextras geoservices webchannel texttospeech serialbus webviewArguments:[files]                   Binaries or directory containing the binary.

部署演示

以我最近写的一个音乐播放器(还没写完)为例

在release模式下编译程序

安排.exe文件

在编译完成后会生成release版本的.exe文件,将其拷贝到某个文件夹下(自己觉得合适的地方)。

这时候点击它是无法运行的,因为它缺少相关的依赖文件。

执行windeployqt

在该文件目录中按shift+鼠标右击打开powershell,并在其中执行

windeployqt musicplayer1.exe

运行完后会在musicplayer.exe(部署目录)下面生成一堆的.dll文件。这下再次点击就可以运行了。如下所示:

引用

[1] Qt for Windows - Deployment

Qt之应用部署(Windows)相关推荐

  1. QT使用windeployqt部署发布及其精简

    #QT技巧 - QT使用windeployqt部署发布及其精简 如需转载请标明出处:http://blog.csdn.net/itas109 QQ技术交流群:129518033 目录 文章目录 #QT ...

  2. MDT 2010之部署Windows XP-5

    实现系统推向客户端安装 将一个没有装过操作系统的计算机作为推送系统的对象,启动设置为网卡启动,启动后DHCP服务器为此客户端分配一个IP地址,之后就进行网卡启动,出现"Press F12 f ...

  3. 图解完整模式安装windows server 2008企业版[为企业部署Windows Server 2008系列四]

    本篇主要是为初次部署windows server 2008的朋友做图文指导,希望对您的提高能够有所帮助. 步骤如下. 1 放入windows server 2008 安装光盘后,重新启动计算机设置bi ...

  4. 企业部署Windows 8 Store 风格应用

    企业部署Windows 8 Store 风格应用 原文:企业部署Windows 8 Store 风格应用 引言 之前我们都知道可以将应用程序发布到Windows 商店中供用户下载使用.如果我们是企业开 ...

  5. 五、MDT 2013 Update 1批量部署-WINDOWS 7样本机镜像部署

    五.MDT 2013 Update 1批量部署-WINDOWS 7样本机镜像部署 5.1 样本机镜像导入 这里选custom p_w_picpath file 选择样本机镜像 不需要复制安装文件 设置 ...

  6. 报告称企业部署Windows 10比此前版本更快

    为微软系统中心配置管理器提供行业领先的跨国IT系统管理解决方案提供商Adaptiva今天公布了<2016年度IT影响力调查报告:Windows 10&ConfigMgr>,在对超过 ...

  7. 企业部署Windows 7指南

    从Windows 7测试版到RC版,相信大家都在体验它给我们带来的各种新特性.无论是安全性,可控性,高效性,简化管理等,Windows 7给我们带来了前所未有的期待.目前大多数企业都把XP系统升级到了 ...

  8. 利用WDS实现零接触部署Windows 7 VHD

    Abner Kou原创,转载请注明出处 利用WDS实现零接触部署Windows 7 VHD 在Windows 7中包含了一项非常强大的功能--native boot,它允许系统从单一的VHD文件启动, ...

  9. 一步步开始集中管理[为企业部署Windows Server 2008系列五] 推荐

    我们通过前面四篇部署windows server 2008 的文章了解到部署的过程和方法: "卍解[为企业部署Windows Server 2008系列一]  " " 完 ...

  10. 网络安全09_部署Windows XP、Windows Server 2003、Windows server 2008、Windows 7 每个虚拟机各两台(2)

    网络安全09_部署Windows XP.Windows Server 2003.Windows server 2008.Windows 7 每个虚拟机各两台(2) https://blog.csdn. ...

最新文章

  1. iOS 绘制圆角矩形
  2. foreach_and_函数
  3. 存在于实数域的微观粒子5-可分类性
  4. 【数据库原理及应用】经典题库附答案(14章全)——第十章:数据库完整性
  5. hdu5115-Dire Wolf【区间dp】
  6. Python下载中国数据库大会(DTCC2020)PPT全集
  7. 解决Another app is currently holding the yum lock; waiting for it to exit...问题
  8. Spring Cloud入门,看这篇就够了!
  9. begin backup导致的故障恢复全过程
  10. 解决请求筛选模块被配置为拒绝包含的查询字符串过长的请求
  11. Matplotlib 基本用法
  12. 用友nc系统服务器端口号,用友NC数据库服务器参数配置说明
  13. Multisim入门
  14. 测试用例的设计方法:等价类划分法
  15. 向量化回测系列2——全市场股票回测
  16. 理解置信区间和置信水平
  17. Spark SQL 快速入门系列(六)Spark SQL 访问 JDBC
  18. 苹果怎么给软件加密码_给SIM卡设置密码被锁了怎么办?解锁的PUK码在哪?
  19. 云南计算机专修学校附中,云南昆明这四所重点中学,师资力量雄厚,教学经验丰富!...
  20. Semantic UI学习(一、开始使用)

热门文章

  1. 为什么我的js function中的代码不起作用了?
  2. 破解linux系统的root密码
  3. Numpy库 numpy.corrcoef()函数
  4. 为什么程序员都很排斥面试时做题?答不出题的程序员会是大牛吗?
  5. mysql VS oracle
  6. 大数据Hive(一):​​​​​​​Hive基本概念
  7. vue-router(路由)详细教程
  8. 计算机教师信息化大赛作品,全国“xx杯”计算机专业类说课大赛优秀作品:信息化色彩搭配训练说课课件.ppt...
  9. Acwing 2944. 回家的路
  10. 【杂记】Directx11 Font