库文件使用说明:
QString fileName,sheetName;
QExcel* mqexcel = new QExcel(fileName);
if(!mqexcel->isExistSheet(sheetName))
{
mqexcel->insertSheet(sheetName);
}
mqexcel->selectSheet(sheetName);
QVariantList m_mapValue; //写入excel文件的内容
QVariantList title; //为excel表添加表头
title<<"name"<<"score"<<"total";
m_mapValue<<(QVariant)title;
QVariantList value; //为excel表添加内容
value<<"xiaoming"<<96<<200;
m_mapValue<<(QVariant)value;
int startRow = 1;
int endRow = m_mapValue.length();
int startCol = 1;
int endCol = title.length();
mqexcel->writeSheet(sheetName,startRow,startCol,endRow,endCol,m_mapValue);
mqexcel->save();
mqexcel->close();