| 192 | } |
| 193 | |
| 194 | void Highlighter::setStyle(const CodeEditorStyle &newStyle) |
| 195 | { |
| 196 | mKeywordFormat.setForeground(newStyle.keywordColor); |
| 197 | mKeywordFormat.setFontWeight(newStyle.keywordWeight); |
| 198 | mClassFormat.setForeground(newStyle.classColor); |
| 199 | mClassFormat.setFontWeight(newStyle.classWeight); |
| 200 | mSingleLineCommentFormat.setForeground(newStyle.commentColor); |
| 201 | mSingleLineCommentFormat.setFontWeight(newStyle.commentWeight); |
| 202 | mMultiLineCommentFormat.setForeground(newStyle.commentColor); |
| 203 | mMultiLineCommentFormat.setFontWeight(newStyle.commentWeight); |
| 204 | mQuotationFormat.setForeground(newStyle.quoteColor); |
| 205 | mQuotationFormat.setFontWeight(newStyle.quoteWeight); |
| 206 | mSymbolFormat.setForeground(newStyle.symbolFGColor); |
| 207 | mSymbolFormat.setBackground(newStyle.symbolBGColor); |
| 208 | mSymbolFormat.setFontWeight(newStyle.symbolWeight); |
| 209 | for (HighlightingRule& rule : mHighlightingRules) { |
| 210 | applyFormat(rule); |
| 211 | } |
| 212 | |
| 213 | for (HighlightingRule& rule : mHighlightingRulesWithSymbols) { |
| 214 | applyFormat(rule); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | void Highlighter::highlightBlock(const QString &text) |
| 219 | { |
no outgoing calls
no test coverage detected