Exporting a document to ODF

From Qt Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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*