23 #include <QPlainTextEdit>
24 #include <QRegularExpression>
27 #include <QStringList>
28 #include <QSyntaxHighlighter>
29 #include <QTextCharFormat>
104 void setError(
const QString &code,
int errorLine,
const QStringList &symbols);
111 void setError(
int errorLine,
const QStringList &symbols);
123 setPlainText(QString());
const QString & getFileName() const
void updateLineNumberAreaWidth(int newBlockCount)
CodeEditor & operator=(const CodeEditor &)=delete
Highlighter * mHighlighter
CodeEditor(const CodeEditor &)=delete
void lineNumberAreaPaintEvent(const QPaintEvent *event)
void updateLineNumberArea(const QRect &, int)
QWidget * mLineNumberArea
void setStyle(const CodeEditorStyle &newStyle)
void setFileName(const QString &fileName)
void resizeEvent(QResizeEvent *event) override
void highlightErrorLine()
CodeEditorStyle * mWidgetStyle
QString generateStyleString()
void setError(const QString &code, int errorLine, const QStringList &symbols)
Set source code to show, goto error line and highlight that line.
CodeEditor(QWidget *parent)
int lineNumberAreaWidth()
QRegularExpression mCommentStartExpression
QTextCharFormat mKeywordFormat
QTextCharFormat mSingleLineCommentFormat
QTextCharFormat mClassFormat
void applyFormat(HighlightingRule &rule)
Highlighter(QTextDocument *parent, CodeEditorStyle *widgetStyle)
QVector< HighlightingRule > mHighlightingRules
QRegularExpression mCommentEndExpression
void highlightBlock(const QString &text) override
QTextCharFormat mQuotationFormat
CodeEditorStyle * mWidgetStyle
void setStyle(const CodeEditorStyle &newStyle)
void setSymbols(const QStringList &symbols)
QTextCharFormat mMultiLineCommentFormat
QTextCharFormat mSymbolFormat
QVector< HighlightingRule > mHighlightingRulesWithSymbols
void paintEvent(QPaintEvent *event) override
QSize sizeHint() const override
LineNumberArea(CodeEditor *editor)
QRegularExpression pattern