Add a messageHandler to take care of qDebug & friends on QML

all qDebug / qCDebug and friends now will be properly
logged into developer -> log, on QML.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2017-06-05 18:16:12 +02:00 committed by Dirk Hohndel
parent e7cd1785c4
commit 0ea6f13891
5 changed files with 101 additions and 7 deletions

View file

@ -23,6 +23,7 @@
#include "mobile-widgets/qmlprofile.h"
#include "core/downloadfromdcthread.h"
#include "qt-models/diveimportedmodel.h"
#include "qt-models/messagehandlermodel.h"
#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
@ -74,6 +75,7 @@ void run_ui()
ctxt->setContextProperty("diveModel", sortModel);
ctxt->setContextProperty("gpsModel", gpsSortModel);
ctxt->setContextProperty("vendorList", vendorList);
ctxt->setContextProperty("logModel", MessageHandlerModel::self());
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
qqWindowObject = engine.rootObjects().value(0);