我是按照这个说明,
安装的
qmakemakemake install
make的时候没有make,使用mingw32-make出错。额,这个库貌似是咱们论坛的人写的。
我的环境是
QT5.7
https://github.com/dbzhang800/QtXlsxWriterDocumentation: http://qtxlsx.debao.meQtXlsx is a library that can read and write Excel files. It doesn't require Microsoft Excel and can be used in any platform that Qt5 supported. The library can be used to- Generate a new .xlsx file from scratch
- Extract data from an existing .xlsx file
- Edit an existing .xlsx file
[/url]Getting Started- For linux user, if your Qt is installed through package manager tools such "apt-get", make sure that you have installed the Qt5 develop package qtbase5-private-dev
[url=https://github.com/dbzhang800/QtXlsxWriter#usage1-use-xlsx-as-qt5s-addon-module]Usage(1): Use Xlsx as Qt5's addon module[/url]Building the module
Note: Perl is needed in this step.
Download the source code.
Put the source code in any directory you like
Go to top directory of the project in a terminal and run
qmakemakemake install
The library, the header files, and others will be installed to your system.
make html_docs can be used to generate documentations of the library, and make check can be used to run unit tests of the library.
[url=https://github.com/dbzhang800/QtXlsxWriter#using-the-module]Using the module- Add following line to your qmake's project file:
QT += xlsx
- Then, using Qt Xlsx in your code
#include <QtXlsx>int main(){QXlsx::Document xlsx;xlsx.write("A1", "Hello Qt!");xlsx.saveAs("Test.xlsx");return 0;}