Cppcheck
|
#include <codeeditor.h>
Public Member Functions | |
CodeEditor (QWidget *parent) | |
CodeEditor (const CodeEditor &)=delete | |
CodeEditor & | operator= (const CodeEditor &)=delete |
~CodeEditor () override | |
void | lineNumberAreaPaintEvent (const QPaintEvent *event) |
int | lineNumberAreaWidth () |
void | setStyle (const CodeEditorStyle &newStyle) |
void | setError (const QString &code, int errorLine, const QStringList &symbols) |
Set source code to show, goto error line and highlight that line. More... | |
void | setError (int errorLine, const QStringList &symbols) |
Goto another error in existing source file. More... | |
void | setFileName (const QString &fileName) |
const QString & | getFileName () const |
void | clear () |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *event) override |
Private Slots | |
void | updateLineNumberAreaWidth (int newBlockCount) |
void | highlightErrorLine () |
void | updateLineNumberArea (const QRect &, int) |
Private Member Functions | |
QString | generateStyleString () |
Private Attributes | |
QWidget * | mLineNumberArea |
Highlighter * | mHighlighter |
CodeEditorStyle * | mWidgetStyle |
int | mErrorPosition |
QString | mFileName |
Definition at line 85 of file codeeditor.h.
|
explicit |
Definition at line 272 of file codeeditor.cpp.
References generateStyleString(), mErrorPosition, mHighlighter, mLineNumberArea, mWidgetStyle, updateLineNumberArea(), and updateLineNumberAreaWidth().
|
delete |
|
override |
Definition at line 305 of file codeeditor.cpp.
References mWidgetStyle.
|
inline |
Definition at line 121 of file codeeditor.h.
References mFileName.
|
private |
Definition at line 448 of file codeeditor.cpp.
References mWidgetStyle, style, CodeEditorStyle::widgetBGColor, and CodeEditorStyle::widgetFGColor.
Referenced by CodeEditor(), and setStyle().
|
inline |
Definition at line 117 of file codeeditor.h.
References mFileName.
|
privateslot |
Definition at line 403 of file codeeditor.cpp.
References CodeEditorStyle::highlightBGColor, mErrorPosition, and mWidgetStyle.
Referenced by setError(), and setStyle().
void CodeEditor::lineNumberAreaPaintEvent | ( | const QPaintEvent * | event | ) |
Definition at line 423 of file codeeditor.cpp.
References CodeEditorStyle::lineNumBGColor, CodeEditorStyle::lineNumFGColor, mLineNumberArea, and mWidgetStyle.
Referenced by LineNumberArea::paintEvent().
int CodeEditor::lineNumberAreaWidth | ( | ) |
Definition at line 363 of file codeeditor.cpp.
Referenced by resizeEvent(), LineNumberArea::sizeHint(), and updateLineNumberAreaWidth().
|
delete |
|
overrideprotected |
Definition at line 396 of file codeeditor.cpp.
References lineNumberAreaWidth(), and mLineNumberArea.
void CodeEditor::setError | ( | const QString & | code, |
int | errorLine, | ||
const QStringList & | symbols | ||
) |
Set source code to show, goto error line and highlight that line.
code | The source code. |
errorLine | line number |
symbols | the related symbols, these are marked |
Definition at line 335 of file codeeditor.cpp.
References getPos(), highlightErrorLine(), mErrorPosition, mHighlighter, and Highlighter::setSymbols().
Referenced by StyleEditDialog::StyleEditDialog().
void CodeEditor::setError | ( | int | errorLine, |
const QStringList & | symbols | ||
) |
Goto another error in existing source file.
errorLine | line number |
symbols | the related symbols, these are marked |
Definition at line 350 of file codeeditor.cpp.
References getPos(), highlightErrorLine(), mErrorPosition, mHighlighter, and Highlighter::setSymbols().
|
inline |
Definition at line 113 of file codeeditor.h.
References mFileName.
void CodeEditor::setStyle | ( | const CodeEditorStyle & | newStyle | ) |
Definition at line 325 of file codeeditor.cpp.
References generateStyleString(), highlightErrorLine(), mHighlighter, mWidgetStyle, and Highlighter::setStyle().
Referenced by StyleEditDialog::updateStyle().
|
privateslot |
Definition at line 385 of file codeeditor.cpp.
References mLineNumberArea, and updateLineNumberAreaWidth().
Referenced by CodeEditor().
|
privateslot |
Definition at line 380 of file codeeditor.cpp.
References lineNumberAreaWidth().
Referenced by CodeEditor(), and updateLineNumberArea().
|
private |
Definition at line 141 of file codeeditor.h.
Referenced by CodeEditor(), highlightErrorLine(), and setError().
|
private |
Definition at line 142 of file codeeditor.h.
Referenced by clear(), getFileName(), and setFileName().
|
private |
Definition at line 139 of file codeeditor.h.
Referenced by CodeEditor(), setError(), and setStyle().
|
private |
Definition at line 138 of file codeeditor.h.
Referenced by CodeEditor(), lineNumberAreaPaintEvent(), resizeEvent(), and updateLineNumberArea().
|
private |
Definition at line 140 of file codeeditor.h.
Referenced by CodeEditor(), generateStyleString(), highlightErrorLine(), lineNumberAreaPaintEvent(), setStyle(), and ~CodeEditor().