Commit d138f842 authored by Karel Slaný's avatar Karel Slaný

Implemented StringManipulation::removeRich() using QTextDocument.

parent d8b5331d
......@@ -21,21 +21,14 @@
* the two.
*/
#include <QXmlStreamReader>
#include <QTextDocument> /* QQuickTextDocument? */
#include "src/qml_interaction/string_manipulation.h"
QString StringManipulation::removeRich(const QString &inStr)
{
QString plainStr;
QXmlStreamReader xml(inStr);
QTextDocument doc;
doc.setHtml(inStr);
while (!xml.atEnd()) {
if (xml.readNext() == QXmlStreamReader::Characters) {
/* Insert additional spaces. */
plainStr += QLatin1String(" ") + xml.text();
}
}
return plainStr;
return doc.toPlainText();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment