Add document property support

Use QObject::setProperty() to do so
This commit is contained in:
Debao Zhang
2013-08-30 15:16:57 +08:00
parent b80286d7b7
commit 9739020b1f
7 changed files with 90 additions and 10 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <QtCore>
#include "xlsxworkbook.h"
#ifdef Q_OS_MAC
# define DATA_PATH "../../../"
#else
# define DATA_PATH "./"
#endif
int main()
{
QXlsx::Workbook workbook;
/*
These properties are visible when you use the
Office Button -> Prepare -> Properties option in Excel and are also
available to external applications that read or index windows files
*/
workbook.setProperty("title", "This is an example spreadsheet");
workbook.setProperty("subject", "With document properties");
workbook.setProperty("creator", "Debao Zhang");
workbook.setProperty("company", "HMICN");
workbook.setProperty("category", "Example spreadsheets");
workbook.setProperty("keywords", "Sample, Example, Properties");
workbook.setProperty("description", "Created with Qt Xlsx");
workbook.save(DATA_PATH"Test.xlsx");
return 0;
}