| 233 | } |
| 234 | |
| 235 | void BasicHighlighter::highlightBlock(const QString &text) |
| 236 | { |
| 237 | foreach (const HighlightingRule &rule, highlightingRules) { |
| 238 | const QRegularExpression expression(rule.pattern); |
| 239 | QRegularExpressionMatchIterator iter = expression.globalMatch(text); |
| 240 | while (iter.hasNext()) { |
| 241 | const auto& match = iter.next(); |
| 242 | if (match.hasMatch()) { |
| 243 | setFormat(match.capturedStart(), match.capturedLength(), rule.format); |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | setCurrentBlockState(0); |
| 248 | } |
| 249 | |
| 250 | BasicCodeViewerWindow::BasicCodeViewerWindow(QWidget *parent, bool doHighlight, bool doWrap, bool doFormat) |
| 251 | : QDialog{parent}, ui(new Ui::BasicCodeViewerWindow) { |
nothing calls this directly
no outgoing calls
no test coverage detected