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 ...
How to make a PC talk industrial serial or fieldbus protocols via RS232/RS485/TCP/MODBUS/CAN/CANopen and the likes. Every now and then you come across this tiny annoying piece of functionality, where Google or Microsoft don't really help out and make you think: "How come no one ever published a small piece of code or some cookbook advice?" So I am happy to share some insight and code.