12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef SYNTAXHIGHLIGHTER_H
- #define SYNTAXHIGHLIGHTER_H
- #include <QSyntaxHighlighter>
- class SyntaxHighlighter :
- public QSyntaxHighlighter
- {
- Q_OBJECT
- public:
- SyntaxHighlighter(QTextDocument *parent = 0);
- protected:
- void highlightBlock(const QString &text) override;
- private:
- /*struct HighlightingRule
- {
- QRegularExpression pattern;
- QTextCharFormat format;
- };
- QVector<HighlightingRule> highlightingRules;
- QRegularExpression commentStartExpression;
- QRegularExpression commentEndExpression;*/
- /**
- * @brief color per loop level
- */
- std::vector<QTextCharFormat> levelColor;
- QTextCharFormat comment;
- bool isBfChar(const QChar& c);
- };
- #endif // SYNTAXHIGHLIGHTER_H
|