-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilehandler.h
More file actions
35 lines (26 loc) · 1.02 KB
/
filehandler.h
File metadata and controls
35 lines (26 loc) · 1.02 KB
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
#ifndef FILEHANDLER_H
#define FILEHANDLER_H
#include <QObject>
#include <QString>
#include <QFile>
#include <QTextStream>
class FileHandler : public QObject {
Q_OBJECT
Q_PROPERTY(QString questionFilePath READ questionFilePath WRITE setQuestionFilePath NOTIFY questionFilePathChanged)
Q_PROPERTY(QString exampleOutputFilePath READ exampleOutputFilePath WRITE setExampleOutputFilePath NOTIFY exampleOutputFilePathChanged)
public:
explicit FileHandler(QObject *parent = nullptr);
QString questionFilePath() const;
void setQuestionFilePath(const QString &filePath);
QString exampleOutputFilePath() const;
void setExampleOutputFilePath(const QString &filePath);
Q_INVOKABLE QString readQuestion(); // Reads the question section
Q_INVOKABLE QString readExampleOutput(); // Reads the example output section
signals:
void questionFilePathChanged();
void exampleOutputFilePathChanged();
private:
QString m_questionFilePath;
QString m_exampleOutputFilePath;
};
#endif // FILEHANDLER_H