MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / setStyle

Method setStyle

gui/codeeditor.cpp:194–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void 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
218void Highlighter::highlightBlock(const QString &text)
219{

Callers 3

updateStyleMethod · 0.80
initializeMethod · 0.80
updateStyleSettingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected