5.1.1.4.2.6. SyntaxHighlighterStyle

This module defines styles for syntax highlighting.

class CodeReview.GUI.DiffViewer.SyntaxHighlighterStyle.SyntaxHighlighterStyle(style='default')[source]

Bases: dict

This class defines a QTextCharFormat for each type of tokens defined by Pygments.

This class has a dictionnary interface and return a copy of the QTextCharFormat instance.

The parameter style select the Pygments style.

Pygments style attributes are:

  • bgcolor,

  • bold,

  • border,

  • color,

  • italic,

  • mono,

  • roman,

  • sans,

  • underline.

CodeReview.GUI.DiffViewer.SyntaxHighlighterStyle.to_brush(colour)[source]

Convert a Pygments colour rrggbb to a Qt brush compatible object.