| 56 | #include <QTextBlock> |
| 57 | |
| 58 | CodeEditor::CodeEditor(QWidget *parent) : |
| 59 | QPlainTextEdit(parent), |
| 60 | m_lineNumberArea(new LineNumberArea(this)) |
| 61 | { |
| 62 | connect(this, &CodeEditor::blockCountChanged, this, &CodeEditor::onBlockCountChanged); |
| 63 | connect(this, &CodeEditor::updateRequest, this, &CodeEditor::updateLineNumberArea); |
| 64 | connect(this, &CodeEditor::cursorPositionChanged, this, &CodeEditor::highlightCurrentLine); |
| 65 | |
| 66 | onBlockCountChanged(0); |
| 67 | highlightCurrentLine(); |
| 68 | } |
| 69 | |
| 70 | int CodeEditor::getLineNumberAreaWidth() const |
| 71 | { |
nothing calls this directly
no outgoing calls
no test coverage detected