Bring Qt5 compatibility to richtext.py plugin