当前位置: 首页 > news >正文

qt 5.15.2压缩和解压缩功能

qt 5.15.2压缩和解压缩功能

主要是添加qt项目文件.pro内容:
这里要先下载quazip的c++项目先编译后引入到本项目中/zip目录下

INCLUDEPATH +=./zip
CONFIG(debug, debug|release) {win32:win32-g++: PRE_TARGETDEPS += $$PWD/zip/libquazipd.awin32:win32-g++: LIBS += -L$$PWD/zip/ -l quazipd
} else {win32:win32-g++: PRE_TARGETDEPS += $$PWD/zip/libquazip.awin32:win32-g++: LIBS += -L$$PWD/zip/ -l quazip
}

完整的qt项目文件.pro内容如下所示:

QT = coreINCLUDEPATH +=./zip
CONFIG(debug, debug|release) {win32:win32-g++: PRE_TARGETDEPS += $$PWD/zip/libquazipd.awin32:win32-g++: LIBS += -L$$PWD/zip/ -l quazipd
} else {win32:win32-g++: PRE_TARGETDEPS += $$PWD/zip/libquazip.awin32:win32-g++: LIBS += -L$$PWD/zip/ -l quazip
}CONFIG += c++17 cmdline# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0SOURCES += \main.cpp# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetDISTFILES += \zip/libquazipd.a \zip/quazipd.dllHEADERS += \zip/JlCompress.h \zip/quazip.h \zip/quazipfile.h \zip/quazipfileinfo.h

根目录下zip目录情况如下所示:

在这里插入图片描述
main.cpp

#include <QCoreApplication>
#include "JlCompress.h"
#include <iostream>int printf(QString line)
{std::cout<<line.toStdString()<<std::endl;
}
int printf(int line)
{std::cout<<line<<std::endl;
}int main(int argc, char *argv[])
{QCoreApplication a(argc, argv);//解压缩JlCompress::extractDir("C:\\data\\obj\\Tile_+006_+006_OBJ.zip","C:\\data\\obj\\Tile_+006_+006_OBJ");printf("解压缩成功");JlCompress::compressDir("c:\\data\\obj\\test55.zip","C:\\data\\obj\\Tile_+006_+006_OBJ");printf("压缩成功");a.quit();return a.exec();
}

本blog地址:https://blog.csdn.net/hsg77

http://www.lryc.cn/news/249786.html

相关文章:

  • thinkphp6出现 htmlentities() expects parameter 1 to be string, array given
  • 【android开发-03】android中Intent的用法介绍
  • Java中时间工具详解:java.time包的应用
  • mysql 日志分析
  • 网络运维与网络安全 学习笔记2023.11.30
  • Perplexity 推出全新大型在线语言模型
  • python中的函数定义
  • 信贷销售经理简历模板
  • js事件流与事件委托/事件代理
  • 代码随想录算法训练营第三十八天| 509 斐波那契数 70 爬楼梯 746 使用最小花费爬楼梯
  • windows 此系统禁止运行脚本报错处理
  • 西南科技大学数字电子技术实验一(数字信号基本参数与逻辑门电路功能测试及FPGA 实现)FPGA部分
  • List系列集合
  • SQL 金额数值转换成中文大写
  • 在Linux上安装KVM虚拟机
  • 软件设计之原型模式
  • Android之高级UI
  • Qt:解决跨线程调用socket/IO类,导致报错的问题
  • 长沙电信大楼火灾调查报告发布:系烟头引发。FIS来护航安全
  • 【Web系列二十七】Vue实现dom元素拖拽并限制移动范围
  • 【IEEE独立出版】2024第四届神经网络、信息与通信工程国际学术会议(NNICE 2024)
  • docker 推送tar包到远程仓库
  • 全志XR806基于FreeRTOS下部署竞技机器人先进模糊控制器
  • python动态加载内容抓取问题的解决实例
  • 系列二十三、将一个第三方的类配置成bean的方式
  • 【长文干货】Python可视化教程
  • 软件工程--需求工程--学习笔记(超详细)
  • TemplateHit中提取query和hit比对上序列索引的映射字典
  • 富必达API:一站式无代码开发集成电商平台、CRM和营销系统
  • 聊聊接口最大并发处理数