3

I am writing a rich text editor using C++ and Qt. For now, I would like it to support (at least) the .odt format.

I found QTextDocumentWriter for writing the contents of the QTextDocument to a file, but I can't seem to find anything to read that back into the QTextDocument, which obviously makes saving it sort of useless in the first place.

So the question is, how do I load an .odt document into a QTextDocument?

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
houbysoft
  • 32,532
  • 24
  • 103
  • 156
  • I don't think there's something predefined for that in the Qt framework (as far as I know, at least). But this may be of interest (untested): http://qt-apps.org/content/show.php/OpenDocument+format+Reader%2BWriter+odt?content=80650 – ChristopheD Sep 19 '10 at 19:53
  • http://bugreports.qt.nokia.com/browse/QTBUG-8837 – smerlin Sep 20 '10 at 00:40

1 Answers1

1

Qt does not currently support the ODT format. Okular has code that does parses ODT to a QTextDocument. Beware: Okular source code is released under GPL license.

Giuseppe Cardone
  • 5,323
  • 2
  • 24
  • 30