Skip to content

Commit

Permalink
rewrite log output 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmnk Freemountainer authored and Dmnk Freemountainer committed Nov 24, 2016
1 parent 2e4168a commit b32d61e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qml-player.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ include(vendor/vendor.pri)
SOURCES += src/cpp/main.cpp \
src/cpp/rootstore.cpp \
src/cpp/environment.cpp \
src/cpp/quarkprocess.cpp
src/cpp/quarkprocess.cpp \
src/cpp/debugger.cpp

HEADERS += \
src/cpp/rootstore.h \
src/cpp/environment.h \
src/cpp/quarkprocess.h \
src/cpp/either.h \
src/cpp/logger.h
src/cpp/logger.h \
src/cpp/debugger.h

RESOURCES += qml.qrc

Expand Down
1 change: 1 addition & 0 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<file>src/qml/Quark/qmldir</file>
<file>src/qml/Quark/jsonpath.js</file>
<file>src/qml/Quark/ListModel.qml</file>
<file>src/qml/Debugger.qml</file>
</qresource>
</RCC>
6 changes: 6 additions & 0 deletions src/cpp/debugger.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "debugger.h"

Debugger::Debugger()
{

}
36 changes: 36 additions & 0 deletions src/cpp/debugger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef DEBUGGER_H
#define DEBUGGER_H

#include <QObject>
#include <QString>
#include <QQuickItem>
#include <QQmlApplicationEngine>

#include "logger.h"

class DebuggerLogger : public QObject, Logger {
public:
DebuggerLogger(QObject* parent = 0) : QObject(parent) {}

void printLine(QString msg) {
emit _log(msg);
}
signals:
void _log(QString msg);

};

class Debugger : public QObject
{
public:
Debugger();
Logger* getLogger();


private:
DebuggerLogger* log;
QQmlApplicationEngine* qmlEngine;

};

#endif // DEBUGGER_H
19 changes: 19 additions & 0 deletions src/qml/Debugger.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import QtQuick 2.2
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import Quark 1.0

ApplicationWindow {
id: window
visible: true
width: 300

TextArea {
anchors.fill: parent
text:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +
"sed do eiusmod tempor incididunt ut labore et dolore magna " +
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation " +
"ullamco laboris nisi ut aliquip ex ea commodo cosnsequat. ";
}
}

0 comments on commit b32d61e

Please sign in to comment.