! * \brief TextDoc::highlightCurrentLine mark the current line */
| 578 | * \brief TextDoc::highlightCurrentLine mark the current line |
| 579 | */ |
| 580 | void TextDoc::highlightCurrentLine() |
| 581 | { |
| 582 | QList<QTextEdit::ExtraSelection> extraSelections; |
| 583 | |
| 584 | if (!isReadOnly()) { |
| 585 | QTextEdit::ExtraSelection selection; |
| 586 | |
| 587 | QColor lineColor = QColor(Qt::blue).lighter(195); |
| 588 | |
| 589 | selection.format.setBackground(lineColor); |
| 590 | selection.format.setProperty(QTextFormat::FullWidthSelection, true); |
| 591 | selection.cursor = textCursor(); |
| 592 | selection.cursor.clearSelection(); |
| 593 | extraSelections.append(selection); |
| 594 | } |
| 595 | |
| 596 | setExtraSelections(extraSelections); |
| 597 | } |
| 598 | |
| 599 | void TextDoc::refreshLanguage() |
| 600 | { |
nothing calls this directly
no test coverage detected