The diff module

A Page intended to display the visual difference between other pages.

class DiffPage(renderer=None)[source]

Bases:, qpageview.multipage.MultiPage

A Page that shows the difference between sub pages.

DiffPage inherits from MultiPage; the pages are to be added in the pages attribute. The first page is considered to be the “default” page, shown the normal way; the others are added in configurable colors and intensity.

opaquePages = False
classmethod createPages(pageLists, renderer=None, pad=<class ''>)[source]

Reimplemented to adapt the page sizes.

renderer = <qpageview.diff.DiffRenderer object>
class DiffDocument(sources=(), renderer=None)[source]

Bases: qpageview.multipage.MultiPageDocument

A Document showing the differences between documents, set as sources.


alias of qpageview.diff.DiffPage

class DiffRenderer[source]

Bases: qpageview.multipage.MultiPageRenderer

Renders the pages by calling their own renderer.

How the difference is displayed can be configured using this renderer. Up to four different pages can be displayed, the colors to render them are taken from the colors instance variable, which is a list.

The alpha channel of each color determines the visiblity of the corresponding sub page.

This renderer works best with pages that are mostly black on a white background.

combine(painter, images)[source]

Paint images on the painter.

We draw bottom-up, using Darken composition mode, so the lower images remain visible.