I need to create a .odt file that contains headings (such as heading 1 or heading 2) and tables.
I tried something like this:
Qt Code:
#include <QString> #include <QTextStream> #include <QTextDocument> #include <QTextDocumentWriter> int main(void) { QString strStream; out << "<!DOCTYPE html>" << "<html>\n" << "<head>" << "<title>Test</title>" << "</head>" << "<body>" << "<h1>Test heading 1</h1>" << "</body>" << "</html>"; document->setHtml(strStream); QTextDocumentWriter writer("test.odt"); writer.setFormat("odf"); writer.write(document); delete document; return 0; }To copy to clipboard, switch view to plain text mode
but the product .odt file has no heading.
Screenshot_2018-08-01_16-50-50.png
what I would like to be heading 1 doesn't have the Heading 1 style, but, in fact, it's a Default Style bold text.
How do I force Heading 1 style?
best regards
Max
Bookmarks