-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompilerprocess.h
More file actions
38 lines (31 loc) · 906 Bytes
/
Copy pathcompilerprocess.h
File metadata and controls
38 lines (31 loc) · 906 Bytes
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
#ifndef COMPILER_PROCESS_H
#define COMPILER_PROCESS_H
#include <QObject>
#include <QProcess>
#include <QTemporaryFile>
#include <QFile>
#include <QTextStream>
#include <QDir>
#include <QFileInfo>
#include <QString>
class CompilerProcess : public QObject
{
Q_OBJECT
public:
explicit CompilerProcess(QObject *parent = nullptr);
~CompilerProcess();
void compile(const QString &sourceCode);
signals:
void compileStarted();
void compileFinished(int exitCode, QProcess::ExitStatus exitStatus, const QString &tempFilePath); // 結束編譯信號
void outputReceived(const QString &output);
void error(const QString &errorMsg);
private slots:
void handleCompileOutput();
void handleCompileError();
void compilationFinished(int exitCode, QProcess::ExitStatus exitStatus);
private:
QProcess *compiler;
QString tempFilePath;
};
#endif // COMPILER_PROCESS_H