mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
3059631226
Test parts of the working functionality
26 lines
530 B
C++
26 lines
530 B
C++
#include "TextUtils.h"
|
|
|
|
#include <QQmlEngine>
|
|
#include <QTextDocumentFragment>
|
|
|
|
TextUtils::TextUtils(QObject *parent) :
|
|
QObject(parent)
|
|
{
|
|
|
|
}
|
|
|
|
QObject *TextUtils::qmlInstance(QQmlEngine *engine, QJSEngine *scriptEngine)
|
|
{
|
|
Q_UNUSED(engine)
|
|
Q_UNUSED(scriptEngine)
|
|
|
|
static TextUtils instance;
|
|
QQmlEngine::setObjectOwnership(&instance, QQmlEngine::CppOwnership);
|
|
|
|
return &instance;
|
|
}
|
|
|
|
QString TextUtils::htmlToPlainText(const QString &html) {
|
|
return QTextDocumentFragment::fromHtml( html ).toPlainText();
|
|
}
|