add QCodeEditor
This commit is contained in:
parent
bccee9bd36
commit
2f3069a388
316 changed files with 98016 additions and 0 deletions
41
external/QCodeEditor/include/internal/QPythonHighlighter.hpp
vendored
Normal file
41
external/QCodeEditor/include/internal/QPythonHighlighter.hpp
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
// QCodeEditor
|
||||
#include <QStyleSyntaxHighlighter> // Required for inheritance
|
||||
#include <QHighlightRule>
|
||||
#include <QHighlightBlockRule>
|
||||
|
||||
// Qt
|
||||
#include <QRegularExpression>
|
||||
#include <QVector>
|
||||
|
||||
class QSyntaxStyle;
|
||||
|
||||
/**
|
||||
* @brief Class, that describes Glsl code
|
||||
* highlighter.
|
||||
*/
|
||||
class QPythonHighlighter : public QStyleSyntaxHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Constructor.
|
||||
* @param document Pointer to document.
|
||||
*/
|
||||
explicit QPythonHighlighter(QTextDocument* document=nullptr);
|
||||
|
||||
protected:
|
||||
void highlightBlock(const QString& text) override;
|
||||
|
||||
private:
|
||||
|
||||
QVector<QHighlightRule> m_highlightRules;
|
||||
QVector<QHighlightBlockRule> m_highlightBlockRules;
|
||||
|
||||
QRegularExpression m_includePattern;
|
||||
QRegularExpression m_functionPattern;
|
||||
QRegularExpression m_defTypePattern;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue