Alex Jbanca 3059631226 Add qml tests for StatusChatInput
Test parts of the working functionality
2022-12-19 10:11:53 +02:00

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();
}