当前位置:网站首页>Qt编译QtXlsx库
Qt编译QtXlsx库
2022-04-23 07:15:00 【欧特_Glodon】
一、QtXlsx库的编译
提供下载包:包含编译好的Qt5.6.3版本、QtXlsx源码以及Perl5软件安装包。
下载地址
1、下载QtXlsx源码
地址:QtXlsxWriter下载地址
下载后解压到自己的磁盘中,路径不要包含空格和特殊字符。

2、安装Perl5
由于编译QtXlsx库需要用到Perl脚本,所以必须确保有这样的执行环境,否则会报错,先cmd进入命令行查看自己是否安装Perl5:

如果没有安装,自行去下载perl5软件进行安装。
3、编译QtXlsx库

用自己安装的Qt打开qtxlsx.pro,然后进行编译即可。

4、使用方法
此处根据编译选择对应的路径:
- 首先将工程文件(路径:QtXlsxWriter-master\src\xlsx)中文件(具体见下面图片)拷贝到新建的QtXlsx文件夹中,最后将QtXlsx文件夹拷贝到Qt的安装目录下,比如我的拷贝到:D:\Qt\Qt5.7.0\5.7\msvc2013_64\include
- 接下来拷贝lib文件夹下Qt5Xlsxd.lib、Qt5Xlsx.lib、Qt5Xlsx.prl、Qt5Xlsxd.prl4个文件到你的Qt的lib下:D:\Qt\Qt5.7.0\5.7\msvc2013_64\lib
- 拷贝lib文件夹下的Qt5Xlsx.dll、Qt5Xlsxd.dll库文件到你的Qt库路径下D:\Qt\Qt5.7.0\5.7\msvc2013_64\bin
- 将构建目录下的mkspecs\modules-inst\qt_lib_xlsx.pri 和qt_lib_xlsx_private.pri到你的Qt模块下D:\Qt\Qt5.7.0\5.7\msvc2013_64\mkspecs\modules
注意:网上有很多说是将mkspecs\modules\qt_lib_xlsx.pri 拷贝到msvc2017\mkspecs\modules,但是这样是结果模块无法加载到项目中,应该是将构建目录下的mkspecs\modules-inst\qt_lib_xlsx.pri 和qt_lib_xlsx_private.pri到msvc2015\mkspecs\modules)
下来就可以使用Qt进行excel的操作了,只是需要注意:
- 使用的时候需要包含头文件#include
- 在.pro需要添加:QT += xlsx
- 完毕之后,最好先qmake再构建工程,否则会提示连接不到库;
之后就可以运行自己的QtXlsx项目了。
版权声明
本文为[欧特_Glodon]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_37251750/article/details/124339715
边栏推荐
猜你喜欢
![[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP](/img/6c/7408180d0c24560b4a68982635520e.jpg)
[programming practice / embedded competition] learning record of embedded competition (II): picture streaming based on TCP

Comparison of indoor positioning methods of several intelligent robots

青苹果影视系统源码 影视聚合 影视导航 影视点播网站源码

Why are there 1px problems? How?

An article understands variable lifting

【Appium】测试时遇到手机内嵌H5页面的切换问题

一篇文章看懂变量提升(hoisting)

Feign source code analysis
![[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface](/img/f1/09de53509479a01098d3cf46bf48eb.jpg)
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface

Smart business card applet business card details page function implementation key code
随机推荐
php生成短链接:将数字转成字母,将字母转成数字
[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test
Go语学习笔记 - 异常处理 | 从零开始Go语言
Summary of facial classics
Anti shake and throttling
一篇文章看懂变量提升(hoisting)
The following program deletes n consecutive words starting from the ith character from the string str
简述CPU
Fibula dynamic programming
Briefly describe the hierarchical strategy of memory
Upload labs range practice
Manipulator motion planning in 3C assembly
C outputs a two-dimensional array with the following characteristics.
DataBinding的使用五
[go]常见的并发模型[泛型版]
将实例化对象的方法 给新的对象用
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface
idea:使用easyYapi插件导出yapi接口
渗透测试面试合集---HVV---
C语言学习记录——삼십팔 字符串函数使用和剖析(2)