MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / highlightBlock

Method highlightBlock

gui/qt/basiccodeviewerwindow.cpp:235–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void 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
250BasicCodeViewerWindow::BasicCodeViewerWindow(QWidget *parent, bool doHighlight, bool doWrap, bool doFormat)
251 : QDialog{parent}, ui(new Ui::BasicCodeViewerWindow) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected