Skip to main content

Posts

Showing posts from January, 2014

Python syntax highlighting for QTextEdit C++/Qt

We were in need for some basic Python syntax highlighting in a QTextEdit box, and didn't immediately want to go fully pro with a Scintilla wrapper. (Update: We did that, too, in the end, according to this scintilla/qt post ). So we looked for a QSyntaxHighlighter subclass for Python formatting, but only found a PyQt example  which seems to be from Torsten Marek (  shlomme.diotavelli.net  ) originally. I asked Frankie to create a C++  Qt4 QSyntaxHighlighter class based on this, so here it is: /* $Id: PythonSyntaxHighlighter.cpp 167 2013-11-03 17:01:22Z oliver $ This is a C++ port of the following PyQt example http://diotavelli.net/PyQtWiki/Python%20syntax%20highlighting C++ port by Frankie Simon ( www.kickdrive.de , www.fuh-edv.de ) The following free software license applies for this file ("X11 license"): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ...