21 #include "parserrunnable.h"
25 #include <QtCore/QDebug>
26 #include <QtCore/QVariant>
28 using namespace QJson;
30 class QJson::ParserRunnable::Private
36 ParserRunnable::ParserRunnable(QObject* parent)
41 qRegisterMetaType<QVariant>(
"QVariant");
44 ParserRunnable::~ParserRunnable()
49 void ParserRunnable::setData(
const QByteArray& data ) {
53 void ParserRunnable::run()
55 qDebug() << Q_FUNC_INFO;
59 QVariant result = parser.
parse (d->m_data, &ok);
61 qDebug() <<
"successfully converted json item to QVariant object";
64 const QString errorText = tr(
"An error occurred while parsing json: %1").arg(parser.
errorString());
65 qCritical() << errorText;