QtXlsx并不存在在安装好的Qt里面,如果要使用,必须要自己下载QtXlsx的源代码加入自己的工程里面
准备工作:
QtXlsx下载地址:https://github.com/QtExcel/QXlsx 或者 https://github.com/dbzhang800/QtXlsxWriter。
git 方式: git clone https://github.com/QtExcel/QXlsx.git
开发环境 VS2015 & Qt5.8.0
配置环境和示例代码:
1. 新建工程并Copy 包含QXlsx源文件的文件到工程目录;
2. 添加包含目录,右击Project->properties->C/C++->general->Additional Include Directories, 添加以下路径:
$(QTDIR)\include
$(QTDIR)\include\QtCore
$(QTDIR)\include\QtCore\5.8.0
$(QTDIR)\include\QtGui
$(QTDIR)\include\QtGui\5.8.0
$(QTDIR)\include\QtGui\5.8.0\QtGui
$(ProjectDir)QXls