2017-09-16 16:34:45 +09:00
|
|
|
// documentproperty.cpp
|
|
|
|
|
2017-09-16 12:21:23 +09:00
|
|
|
#include <QtCore>
|
|
|
|
#include "xlsxdocument.h"
|
|
|
|
|
2017-09-16 16:34:45 +09:00
|
|
|
int documentproperty()
|
2017-09-16 12:21:23 +09:00
|
|
|
{
|
|
|
|
QXlsx::Document xlsx;
|
|
|
|
xlsx.write("A1", "View the properties through:");
|
|
|
|
xlsx.write("A2", "Office Button -> Prepare -> Properties option in Excel");
|
|
|
|
|
|
|
|
xlsx.setDocumentProperty("title", "This is an example spreadsheet");
|
|
|
|
xlsx.setDocumentProperty("subject", "With document properties");
|
|
|
|
xlsx.setDocumentProperty("creator", "Debao Zhang");
|
|
|
|
xlsx.setDocumentProperty("company", "HMICN");
|
|
|
|
xlsx.setDocumentProperty("category", "Example spreadsheets");
|
|
|
|
xlsx.setDocumentProperty("keywords", "Sample, Example, Properties");
|
|
|
|
xlsx.setDocumentProperty("description", "Created with Qt Xlsx");
|
|
|
|
|
2017-09-23 11:12:59 +09:00
|
|
|
xlsx.saveAs("documentproperty.xlsx");
|
2017-09-16 12:21:23 +09:00
|
|
|
return 0;
|
|
|
|
}
|