diff options
Diffstat (limited to 'utils/themeeditor/gui/codeeditor.cpp')
| -rw-r--r-- | utils/themeeditor/gui/codeeditor.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/utils/themeeditor/gui/codeeditor.cpp b/utils/themeeditor/gui/codeeditor.cpp index 3858460..9a2a018 100644 --- a/utils/themeeditor/gui/codeeditor.cpp +++ b/utils/themeeditor/gui/codeeditor.cpp @@ -38,8 +38,6 @@ #include "codeeditor.h" -//![constructor] - CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent), completer(this) { @@ -58,10 +56,6 @@ CodeEditor::CodeEditor(QWidget *parent) settings.beginGroup("CodeEditor"); } -//![constructor] - -//![extraAreaWidth] - int CodeEditor::lineNumberAreaWidth() { int digits = 1; @@ -76,19 +70,12 @@ int CodeEditor::lineNumberAreaWidth() return space; } -//![extraAreaWidth] - -//![slotUpdateExtraAreaWidth] void CodeEditor::updateLineNumberAreaWidth(int /* newBlockCount */) { setViewportMargins(lineNumberAreaWidth(), 0, 0, 0); } -//![slotUpdateExtraAreaWidth] - -//![slotUpdateRequest] - void CodeEditor::updateLineNumberArea(const QRect &rect, int dy) { if (dy) @@ -100,8 +87,6 @@ void CodeEditor::updateLineNumberArea(const QRect &rect, int dy) updateLineNumberAreaWidth(0); } -//![slotUpdateRequest] - void CodeEditor::cursorMoved() { /* Closing the completer if the cursor has moved out of its bounds */ @@ -138,8 +123,6 @@ void CodeEditor::insertTag() completer.hide(); } -//![resizeEvent] - void CodeEditor::resizeEvent(QResizeEvent *e) { QPlainTextEdit::resizeEvent(e); @@ -149,8 +132,6 @@ void CodeEditor::resizeEvent(QResizeEvent *e) lineNumberAreaWidth(), cr.height())); } -//![resizeEvent] - void CodeEditor::keyPressEvent(QKeyEvent *event) { @@ -256,23 +237,16 @@ void CodeEditor::keyPressEvent(QKeyEvent *event) } -//![extraAreaPaintEvent_0] - void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event) { QPainter painter(lineNumberArea); painter.fillRect(event->rect(), Qt::lightGray); -//![extraAreaPaintEvent_0] - -//![extraAreaPaintEvent_1] QTextBlock block = firstVisibleBlock(); int blockNumber = block.blockNumber(); int top = (int) blockBoundingGeometry(block).translated(contentOffset()).top(); int bottom = top + (int) blockBoundingRect(block).height(); -//![extraAreaPaintEvent_1] -//![extraAreaPaintEvent_2] while (block.isValid() && top <= event->rect().bottom()) { if (block.isVisible() && bottom >= event->rect().top()) { QString number = QString::number(blockNumber + 1); @@ -293,5 +267,4 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event) ++blockNumber; } } -//![extraAreaPaintEvent_2] |