Exporting a document to ODF: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Add "cleanup" tag)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
h1. Exporting a document to ODF
h1. Exporting a document to ODF



Revision as of 15:37, 3 March 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

h1. Exporting a document to ODF

Qt, the latest editions, supports the open document formats (Odf). A QTextDocument can be directly converted to odf. In fact, ODF is the default conversion format.

QTextDocumentWriter makes the conversion easier.

For example :

QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
 "untitled",tr("Open Document ('''.odf)"));
QTextDocumentWriter odfWritter(fileName);
odfWritter.write(doc); // doc is QTextDocument'''

Categories snippets