We can read and modify existing simple .xlsx file now

This commit is contained in:
Debao Zhang
2013-10-19 13:28:06 +08:00
parent 7f218898b6
commit d04a02e55c
16 changed files with 135 additions and 33 deletions
@@ -0,0 +1,10 @@
/*!
\title Xlsx Readwrite Example
\example readwrite
\brief Open an existing xlsx file, modify and save it.
\ingroup qtxlsx
This example demonstrates how to modify an existing
.xlsx file with Qt Xlsx Library.
*/
+18
View File
@@ -0,0 +1,18 @@
#include "xlsxdocument.h"
int main()
{
//Generate a simple xlsx file at first.
QXlsx::Document xlsx;
xlsx.write("A1", "Hello Qt!");
xlsx.write("A2", 500);
xlsx.saveAs("first.xlsx");
//Read, edit, save
QXlsx::Document xlsx2("first.xlsx");
xlsx2.addWorksheet("Second");
xlsx2.write("A1", "Hello Qt again!");
xlsx2.saveAs("second.xlsx");
return 0;
}
+12
View File
@@ -0,0 +1,12 @@
TARGET = mergecells
#include(../../../src/xlsx/qtxlsx.pri)
QT += xlsx
TARGET = readwrite
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp