O'Reilly logo

Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt Programming by Mark Summerfield

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13. Rich Text and Printing

PyQt supports rich text, essentially a subset of HTML that also includes some support for CSS (cascading style sheets).* This means that in practice, we can pass strings that contain HTML markup to many of PyQt’s text-handling classes and rely on PyQt to render the HTML properly in the user interface.

We have already seen examples of passing HTML to QLabels. The graphics item class QGraphicsTextItem can also accept HTML. The QTextBrowser class supports basic HTML display including hyperlinks, and although it is by no means a full-blown Web browser, many developers find it sufficient for displaying help text. For editing HTML, PyQt provides the QTextEdit class. Although this class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required