Small Python library to use parce with Qt’s QTextDocument.

This module depends on parce ( and PyQt(


from PyQt5.QtWidgets import QApplication, QTextEdit
from PyQt5.QtGui import QTextDocument

app = QApplication([])
doc = QTextDocument()
e = QTextEdit()
e.resize(600, 400)

import parceqt
from parce.lang.xml import Xml

parceqt.set_root_lexicon(doc, Xml.root)

Now the text in the document is automatically highlighted using the specified root lexicon; the highlighting is updated as the user modifies the text.

This manual documents version 0.17.0. Last update: May 08, 2021.

Indices and tables