-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputhandler.h
39 lines (36 loc) · 1005 Bytes
/
outputhandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef OUTPUTHANDLER_H
#define OUTPUTHANDLER_H
#include <QPlainTextEdit>
#include <QProcess>
#include <QDebug>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QLineEdit>
#include <sstream>
#include "editor.h"
class OutputHandler : public QObject {
Q_OBJECT
public:
OutputHandler(QObject* parent, Editor * const, Editor * const, QLineEdit* const);
void clear();
void acOutputReceived(const QByteArray&);
void userOutputReceived(const QByteArray&);
void userProgCrashed();
void userProgTimedOut();
void toggleFilter();
void setExecutionTime(const qint64 t);
private:
Editor * const acOut;
Editor * const userOut;
QLineEdit * const resultLine;
QTextCharFormat green, red, white;
std::string acTxt, userTxt;
qint64 executionTime;
bool acReady, userReady, cleared, filter;
void compareOutputs();
signals:
void outputResult(const bool success);
void comparisonFinished();
};
#endif // OUTPUTHANDLER