| 26 | } |
| 27 | |
| 28 | void DiffHighlighter::highlightBlock(const QString &text) |
| 29 | { |
| 30 | if (text.startsWith(QChar('-'))) { |
| 31 | setFormat(0, static_cast<int>(text.size()), QColor(Qt::red)); |
| 32 | } else if (text.startsWith(QChar('+'))) { |
| 33 | setFormat(0, static_cast<int>(text.size()), QColor(Qt::green)); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | } // namespace QtGui |