英文可以的同学建议直接看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. 28本实体书包邮免费送!年前替我领回家!
  2. 平时工作事项太多,有哪些好用的事项管理软件?
  3. 全面对比,深度解析 Ignite 与 Spark
  4. log4php的使用
  5. Tensorflow实例:(卷积神经网络)LeNet-5模型
  6. Elasticsearch之CURL命令的version控制
  7. 华为手机asph啥机型_华为正式宣布!19款机型开启新系统内测,你的手机榜首有名吗?...
  8. 多项式相乘快速算法原理及相应C代码实现
  9. mongodb同时更新一条记录_MongoDB 存储和优化系列一
  10. ES6新特性_ES6集合介绍与API---JavaScript_ECMAScript_ES6-ES11新特性工作笔记030
  11. Mysql中实现多表关联查询更新操作
  12. 面向对象第二单元总结
  13. 他说,编程的黄金时代已到
  14. Altium Designer——AD画PCB图步骤总结
  15. 热门开源Web开发框架推荐
  16. 数学建模中各种评价类模型的优点和缺点总结
  17. 汤唯:《在街头卖艺的那些日子》
  18. 【易通慧谷】供应链金融六大模式解析
  19. ANDROID 开源库
  20. 计算机学院姚茜,2019年东南大学计算机科学与工程学院硕士研究生拟录取名单公示...

热门文章

  1. 「LibreOJ NOI Round #2」单枪匹马
  2. 北风:如何自学营销策划和网络营销?
  3. 京东集团副总裁李大学:像CEO一样思考 - Dancen的专栏 - 博客频道 - CSDN.NET
  4. composer安装依赖包
  5. 科技周刊第六期:接近本质的东西才会长远
  6. 江苏省计算机等级考试理论试题,2015江苏省计算机等级考试试题 二级ACCESS理论考试试题及答案...
  7. 小米红米Note4X(高配版)线刷兼救砖_解账户锁_纯净刷机包_教程
  8. matlab如何将mat转为wav,Matlab的wav文件转为mat文件源程序
  9. 右侧追击(一)——东方财富
  10. python 日期字符串转换时间戳