qt中安装第三方库Qtxlsx将数据存为xlsx以及xls格式

2023年11月14日 10:25 ry 828

最近在开发一个采集器的项目,需要将数据存为csv,xlsx,xls等格式,发现后面2中各种qt没有现成的包,因此我们通过第三方平台的包进行编译安装,我们去下载源码,网址如下https://github.com/dbzhang800/qtxlsxwriter 。然后开始按照里面的文档进行编译,如图所示

然后分别执行下面的命令

    qmake
    make
    make install

如果执行到make报错'perl' 不是内部或外部命令,也不是可运行的程序,直接去网址下载即可,网址为https://strawberryperl.com/ 。

安装完后在cmd命令输入

perl -v

如果显示如下,表示安装成功

C:\Users\14499>perl -v
Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter.

This is perl 5, version 38, subversion 0 (v5.38.0) built for MSWin32-x64-multi-thread

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

然后就可以继续make,make install命令了,最后在pro文件中加上QT += xlsx即可,然后再cpp中加入

#include<QtXlsx>

即可,完美解决!

如果上述代码帮助您很多,可以打赏下以减少服务器的开支吗,万分感谢!

欢迎发表评论~

点击此处登录后即可评论


评论列表
2023年11月17日 14:33 ry: 回复
本人承接各种软件定制,数据采集,接口搭建,网站开发,环境配置的杂活,需要的可以联系我 qq:1449917271 微信:liuyoudyping


赣ICP备2021001574号-1

赣公网安备 36092402000079号