]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.cpp
GuiAlert: Convert html to plain text on console output
[lyx.git] / src / frontends / qt4 / qt_helpers.cpp
index 2ad96d9295442c90c432b966130d006410cec0a3..88c4ab9424e6b341b258583df99cbf721511ec52 100644 (file)
@@ -683,4 +683,14 @@ QString formatToolTip(QString text, int em)
 }
 
 
+QString qtHtmlToPlainText(QString const & html)
+{
+       if (!Qt::mightBeRichText(html))
+               return html;
+       QTextDocument td;
+       td.setHtml(html);
+       return td.toPlainText();
+}
+
+
 } // namespace lyx