-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheditortab.h
executable file
·39 lines (35 loc) · 943 Bytes
/
editortab.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 EDITORTAB_H
#define EDITORTAB_H
#include <QWidget>
#include <Qsci/qsciscintilla.h>
#include <QFile>
class EditorTab : public QWidget
{
Q_OBJECT
public:
explicit EditorTab(bool hostfile = true,QWidget *parent = nullptr);
explicit EditorTab(QString filePath,bool hostfile = true,QWidget *parent = nullptr);
~EditorTab();
QsciScintilla *ed;
void setFilePath(QString filePath);
void setLexer(QString filePath);
QString getFilePath();
void saveFile(QString path);
bool is_host_file();
void set_host_file(bool host);
void set_current_content(QString content);
signals:
void content_changed(bool ch);
private:
QString mFilePath;
QByteArray mFileContent;
bool hostfile;
QFile *mFile;
void openFile(QString path);
private slots:
void on_content_changed();
signals:
void saveTargetFile(QString path, QByteArray content);
public slots:
};
#endif // EDITORTAB_H