QtNovelUI/WordsIDE/keywordshightlighter.h

31 lines
610 B
C++

#ifndef WORDSHIGHTLIGHTER_H
#define WORDSHIGHTLIGHTER_H
#include <QObject>
#include <QSyntaxHighlighter>
#include <libParse.h>
namespace Enhancement {
/**
* @brief 词语语法高亮
*/
class KeywordsHightlighter : public QSyntaxHighlighter
{
public:
KeywordsHightlighter(QObject *parent = nullptr);
void reset(Parse::Result::DocCore *base);
private:
Parse::Result::DocCore *parse_core;
// QSyntaxHighlighter interface
protected:
virtual void highlightBlock(const QString &text) override;
};
}
#endif // WORDSHIGHTLIGHTER_H