This is a simple code editor widget for Python and Qt supporting multiple languages and color themes.
- Syntax and theming support powered by Pygments, so any language and theme supported by it can be used
- Hide and show line numbers
- Spaces or tabs for indentation
The CodeEdit widget is based on QPlainTextEdit
and syntax highlight is provided by a Pygments
based implementation of QSyntaxHighlighter
. The line number implementation was based on this
sample from the Qt docs, with a
bit of cleanup and refactoring on my part.