Exporting a document to ODF: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Exporting a document to <span class="caps">ODF</span>=
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, <span class="caps">ODF</span> 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.


QTextDocumentWriter makes the conversion easier.
QTextDocumentWriter makes the conversion easier.
Line 7: Line 7:
For example :
For example :


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

Revision as of 10:25, 24 February 2015

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(&quot;Save File&amp;quot;),<br /> &quot;untitled&amp;quot;,tr(&quot;Open Document ('''.odf)&quot;));<br />QTextDocumentWriter odfWritter(fileName);<br />odfWritter.write(doc); // doc is QTextDocument'''

Categories
snippets