1、安装ActivePerl
2、打开pro文件,直接编译即可
第一个简单实例:
#include "xlsxcellrange.h"
#include "xlsxchart.h"
#include "xlsxchartsheet.h"
#include "xlsxdocument.h"
#include "xlsxrichstring.h"
#include "xlsxworkbook.h"
using namespace QXlsx;
QXlsx::Document xlsxW;
int row = 1;
int col = 1; //
// xlsxW.write("A1", "Hello Qt!"); // write "Hello Qt!" to cell(A,1). it's shared string.
QVariant writeValue = QString("Hello Qt!");
xlsxW.write(row, col, writeValue);
if (xlsxW.saveAs("Test.xlsx")) // save the document as 'Test.xlsx'
{
qDebug() << "[debug] success to write xlsx file";
}
else {
qDebug() << "[debug][error] failed to write xlsx file";
}