mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-30 05:02:52 +08:00
update markdown
This commit is contained in:
parent
118311edf8
commit
26dddeb3c9
16
Example.md
16
Example.md
@ -15,27 +15,27 @@ using namespace QXlsx;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
// [1] Writing excel file(*.xlsx)
|
||||
// [1] Writing excel file(*.xlsx)
|
||||
QXlsx::Document xlsxW;
|
||||
xlsxW.write("A1", "Hello Qt!"); // write "Hello Qt!" to cell(A,1). it's shared string.
|
||||
xlsxW.saveAs("Test.xlsx"); // save the document as 'Test.xlsx'
|
||||
|
||||
// [2] Reading excel file(*.xlsx)
|
||||
// [2] Reading excel file(*.xlsx)
|
||||
Document xlsxR("Test.xlsx"); // load excel file
|
||||
if (xlsxR.isLoadPackage())
|
||||
{
|
||||
int row = 1; int col = 1;
|
||||
{
|
||||
int row = 1; int col = 1;
|
||||
Cell* cell = xlsxR.cellAt(row, col); // get cell pointer.
|
||||
if ( cell != NULL )
|
||||
{
|
||||
QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...)
|
||||
qDebug() << var; // display value
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user