Exporting a document to ODF: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Convert ExpressionEngine section headers)
(Cleanup)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
{{LangSwitch}}
 
[[Category:snippets]]
= 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.
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.


Line 8: Line 7:
For example :
For example :


<code>QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
<code>
"untitled",tr("Open Document ('''.odf)"));
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
    "untitled",tr("Open Document ('''.odf)"));
QTextDocumentWriter odfWritter(fileName);
QTextDocumentWriter odfWritter(fileName);
odfWritter.write(doc); // doc is QTextDocument'''</code>
odfWritter.write(doc); // doc is QTextDocument*
 
</code>
'''Categories'''
[[snippets]]

Revision as of 17:43, 28 June 2015

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

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*