You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
671 B
35 lines
671 B
#include <QtCore>
|
|
#include "xlsxdocument.h"
|
|
#include "xlsxrichstring.h"
|
|
#include "xlsxformat.h"
|
|
int main()
|
|
{
|
|
//![0]
|
|
QXlsx::Document xlsx;
|
|
//![0]
|
|
|
|
//![1]
|
|
QXlsx::Format blue;
|
|
blue.setFontColor(Qt::blue);
|
|
QXlsx::Format red;
|
|
red.setFontColor(Qt::red);
|
|
red.setFontSize(15);
|
|
QXlsx::Format bold;
|
|
bold.setFontBold(true);
|
|
|
|
QXlsx::RichString rich;
|
|
rich.addFragment("Hello ", blue);
|
|
rich.addFragment("Qt ", red);
|
|
rich.addFragment("Xlsx", bold);
|
|
xlsx.write("B2", rich);
|
|
//![1]
|
|
|
|
//![2]
|
|
xlsx.saveAs("Test1.xlsx");
|
|
//![2]
|
|
|
|
QXlsx::Document("Test1.xlsx");
|
|
xlsx.saveAs("Test2.xlsx");
|
|
|
|
return 0;
|
|
}
|
|
|