mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-16 04:42:53 +08:00
QXlsx
Excel reader/writer library
- QXlsx is excel file(*.xlsx) reader/writer library.
- It is written for static library using Qt 5.
License
- QXlsx is licensed under the GPL License https://www.gnu.org/licenses/gpl-3.0.en.html
- Original source code from Debao Zhang(2014) : https://github.com/dbzhang800/QtXlsxWriter
- Qt License (see Qt Company site) : https://www.qt.io/
Hello excel
Writing excel file
QXlsx::Document xlsx;
xlsx.write("A1", "Hello Qt!"); // write "Hello Qt!" to cell(A,1). it's shared string.
xlsx.saveAs("Test.xlsx"); // save the document as 'Test.xlsx'
Reading excel file
// get cell pointer.
Cell* cell = xlsx.cellAt(1, 2); // row is 1. column is 2.
if ( cell == NULL )
continue; // cell vaule is not set
QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...)
qint32 styleNo = cell->styleNumber(); // read cell style number
if ( styleNo >= 0 )
qDebug() << row << " " << var << " , style:" << styleNo;
else
qDebug() << row << " " << var;
How to build
Test environment
To test
The following tests should be performed.
- testing Microsoft Office(Excel) Online
- testing Google Docs(Spreadsheet)
- testing LibreOffice
Contact
- j2doll@gmail.com
- Hi! My native language is not English. My English is not fluent. Please use EASY English. :-)
Languages
C++
76.5%
C
20.3%
QMake
1.7%
CMake
1.3%
QML
0.1%