I can't seem to find anything on this anywhere, but it appears as though links are not supported QTextDocument writer when writing in odf.
cursor.insertHtml("<a href=\"http://google.com\">Link</a>");
QTextDocumentWriter writer("test.odf", "odf");
writer.write(&document);
QTextDocumentWriter writer2("test.html", "html");
writer2.write(&document);
return a.exec();
QApplication a(argc, argv);
QTextDocument document;
QTextCursor cursor(&document);
cursor.insertHtml("<a href=\"http://google.com\">Link</a>");
QTextDocumentWriter writer("test.odf", "odf");
writer.write(&document);
QTextDocumentWriter writer2("test.html", "html");
writer2.write(&document);
return a.exec();
To copy to clipboard, switch view to plain text mode
When I run this, the test.html has a link that you can click. In the odf file, however, the text is just formatted ( blue and underlined ) and not a true link. And ctrl+click does not do anything. Does this mean it's simply not supported? Or is there something I'm missing? Thank you.
Bookmarks