-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyqsyntaxhighlighter.h
More file actions
69 lines (44 loc) · 1.42 KB
/
Copy pathmyqsyntaxhighlighter.h
File metadata and controls
69 lines (44 loc) · 1.42 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef MYQSYNTAXHIGHLIGHTER_H
#define MYQSYNTAXHIGHLIGHTER_H
#include <QObject>
#include<QRegularExpression>
#include<QTextCharFormat>
#include<QSyntaxHighlighter>
#include<QSysInfo>
#include"textfont.h"
#include"palette.h"
extern TEXTFONT * SOUL;
extern TEXTFONT NEW_FONT;
class MyQSyntaxHighlighter:public QSyntaxHighlighter
{
public:
explicit MyQSyntaxHighlighter(QTextDocument *parent=nullptr);
void TextFormatChange();
void highlightBlock(const QString &text)override;
// QString mFontFamily="Consolas";
// int mFontSize=12;
struct HighlightRule
{
QRegularExpression pattern;
QTextCharFormat format;
};
void mSetPatternFormat(QTextCharFormat &f1,HighlightRule &r1,QTextCharFormat &f2,HighlightRule &r2,QString &Keyword,QColor &color,QColor &color2);
std::vector<HighlightRule>HR;
void addNumberTextFormat();
void addStringTextFormat();
void addKeywordTextFormat();
void addQuickMoveTextFormat();
void addLineMoveTextFormat();
void addCircularArcMoveTextFormat2();
void addCircularArcMoveTextFormat3();
void addGTxtFormat();
void addFTextFormat();
void addRTectFormat();
void addMTextFormat();
void addCustomerKeywordTextFormat();
void addRemarkSiemensTextFormat();
void addRemarkOtherTextFormat();
void G0LineFormat(const QString &text);
void NFragmentTextFormat();
};
#endif // MYQSYNTAXHIGHLIGHTER_H