Browse Source

Remove the readwrite example

master
Debao Zhang 11 years ago
parent
commit
f3e59183a9
  1. BIN
      examples/xlsx/readwrite/doc/images/readwrite.png
  2. 18
      examples/xlsx/readwrite/doc/src/readwrite.qdoc
  3. 34
      examples/xlsx/readwrite/main.cpp
  4. 12
      examples/xlsx/readwrite/readwrite.pro
  5. 1
      examples/xlsx/xlsx.pro

BIN
examples/xlsx/readwrite/doc/images/readwrite.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

18
examples/xlsx/readwrite/doc/src/readwrite.qdoc

@ -1,18 +0,0 @@
/*!
\title Xlsx Readwrite Example
\example readwrite
\brief Open an existing xlsx file, modify and save it.
\ingroup qtxlsx-examples
This example demonstrates how to modify an existing
.xlsx file with Qt Xlsx Library.
\image readwrite.png
At first, we create an empty xlsx file, set the properties of the document,
write some content to the worksheet, then save it.
\snippet readwrite/main.cpp 0
Then we open the exists xlsx file, add some data to it.
\snippet readwrite/main.cpp 1
*/

34
examples/xlsx/readwrite/main.cpp

@ -1,34 +0,0 @@
#include "xlsxdocument.h"
#include "xlsxformat.h"
int main()
{
//Generate a simple xlsx file at first.
//![0]
QXlsx::Document xlsx;
xlsx.setDocumentProperty("title", "This is an example spreadsheet");
xlsx.setDocumentProperty("creator", "Qt Xlsx Library");
xlsx.setSheetName("First Sheet");
QXlsx::Format *format = xlsx.createFormat();
format->setFontColor(QColor(Qt::blue));
format->setFontSize(15);
format->setBorderStyle(QXlsx::Format::BorderDashDotDot);
format->setPatternBackgroundColor(QColor(Qt::gray));
format->setHorizontalAlignment(QXlsx::Format::AlignHCenter);
xlsx.write("A1", "Hello Qt!", format);
xlsx.write("A2", 500);
xlsx.saveAs("first.xlsx");
//![0]
//Read, edit, save
//![1]
QXlsx::Document xlsx2("first.xlsx");
xlsx2.write("A3", "Hello Qt again!");
xlsx2.addWorksheet("Second Sheet");
xlsx2.write("A1", "Hello Qt again!");
xlsx2.setCurrentWorksheet(0);
xlsx2.saveAs("second.xlsx");
//![1]
return 0;
}

12
examples/xlsx/readwrite/readwrite.pro

@ -1,12 +0,0 @@
TARGET = mergecells
#include(../../../src/xlsx/qtxlsx.pri)
QT += xlsx
TARGET = readwrite
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

1
examples/xlsx/xlsx.pro

@ -7,7 +7,6 @@ SUBDIRS = hello \
mergecells \
rowcolumn \
numberformat \
readwrite \
datavalidation \
definename \
demo

Loading…
Cancel
Save