Make RichString public
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -0,0 +1,11 @@
|
||||
/*!
|
||||
\example richtext
|
||||
\title Rich Text Example
|
||||
\brief This is a simplest Qt Xlsx example.
|
||||
\ingroup qtxlsx-examples
|
||||
|
||||
This example demonstrates how to create a new
|
||||
.xlsx file containing some basic data and calculations
|
||||
with Qt Xlsx Library. So lets see how this is achieved.
|
||||
\image richtext.png
|
||||
*/
|
||||
@@ -0,0 +1,35 @@
|
||||
#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;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
TARGET = hello
|
||||
|
||||
#include(../../../src/xlsx/qtxlsx.pri)
|
||||
QT+=xlsx
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
SOURCES += main.cpp
|
||||
@@ -10,5 +10,6 @@ SUBDIRS = hello \
|
||||
datavalidation \
|
||||
definename \
|
||||
formulas \
|
||||
richtext \
|
||||
demo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user