Skip to content

Commit b32d61e

Browse files
Dmnk FreemountainerDmnk Freemountainer
Dmnk Freemountainer
authored and
Dmnk Freemountainer
committed
rewrite log output 2
1 parent 2e4168a commit b32d61e

File tree

5 files changed

+66
-2
lines changed

5 files changed

+66
-2
lines changed

qml-player.pro

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ include(vendor/vendor.pri)
99
SOURCES += src/cpp/main.cpp \
1010
src/cpp/rootstore.cpp \
1111
src/cpp/environment.cpp \
12-
src/cpp/quarkprocess.cpp
12+
src/cpp/quarkprocess.cpp \
13+
src/cpp/debugger.cpp
1314

1415
HEADERS += \
1516
src/cpp/rootstore.h \
1617
src/cpp/environment.h \
1718
src/cpp/quarkprocess.h \
1819
src/cpp/either.h \
19-
src/cpp/logger.h
20+
src/cpp/logger.h \
21+
src/cpp/debugger.h
2022

2123
RESOURCES += qml.qrc
2224

qml.qrc

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
<file>src/qml/Quark/qmldir</file>
55
<file>src/qml/Quark/jsonpath.js</file>
66
<file>src/qml/Quark/ListModel.qml</file>
7+
<file>src/qml/Debugger.qml</file>
78
</qresource>
89
</RCC>

src/cpp/debugger.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "debugger.h"
2+
3+
Debugger::Debugger()
4+
{
5+
6+
}

src/cpp/debugger.h

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef DEBUGGER_H
2+
#define DEBUGGER_H
3+
4+
#include <QObject>
5+
#include <QString>
6+
#include <QQuickItem>
7+
#include <QQmlApplicationEngine>
8+
9+
#include "logger.h"
10+
11+
class DebuggerLogger : public QObject, Logger {
12+
public:
13+
DebuggerLogger(QObject* parent = 0) : QObject(parent) {}
14+
15+
void printLine(QString msg) {
16+
emit _log(msg);
17+
}
18+
signals:
19+
void _log(QString msg);
20+
21+
};
22+
23+
class Debugger : public QObject
24+
{
25+
public:
26+
Debugger();
27+
Logger* getLogger();
28+
29+
30+
private:
31+
DebuggerLogger* log;
32+
QQmlApplicationEngine* qmlEngine;
33+
34+
};
35+
36+
#endif // DEBUGGER_H

src/qml/Debugger.qml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import QtQuick 2.2
2+
import QtQuick.Controls 2.0
3+
import QtQuick.Layouts 1.3
4+
import Quark 1.0
5+
6+
ApplicationWindow {
7+
id: window
8+
visible: true
9+
width: 300
10+
11+
TextArea {
12+
anchors.fill: parent
13+
text:
14+
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +
15+
"sed do eiusmod tempor incididunt ut labore et dolore magna " +
16+
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation " +
17+
"ullamco laboris nisi ut aliquip ex ea commodo cosnsequat. ";
18+
}
19+
}

0 commit comments

Comments
 (0)