| 68 | } |
| 69 | |
| 70 | void CodeEditor::highlightCurrentLine() |
| 71 | { |
| 72 | QList<QTextEdit::ExtraSelection> extraSelections; |
| 73 | if(highlightLine&&!isReadOnly()) { |
| 74 | QTextEdit::ExtraSelection selection; |
| 75 | selection.format.setBackground(QColor(240,240,240)); |
| 76 | selection.format.setProperty(QTextFormat::FullWidthSelection, true); |
| 77 | selection.cursor = textCursor(); |
| 78 | selection.cursor.clearSelection(); |
| 79 | extraSelections.append(selection); |
| 80 | } |
| 81 | setExtraSelections(extraSelections); |
| 82 | } |
| 83 | |
| 84 | void CodeEditor::setFileName(const QString& f) |
| 85 | { |