The multipage module¶
A MultiPage has no contents itself (but it has a size!), and renders a list of embedded pages.
The MultiPageRenderer has the same interface as an ordinary renderer, but defers rendering to the renderer of the embedded pages.
-
class
MultiPage
(renderer=None)[source]¶ Bases:
qpageview.page.AbstractRenderedPage
A special Page that has a list of embedded sub pages.
The sub pages are in the pages attribute, the first one is on top.
The position and size of the embedded pages is set in the updateSize() method, which is inherited from AbstractPage. By default all sub pages are centered in their natural size.
Rotation of sub pages is relative to the MultiPage.
The scalePages instance attribute can be used to multiply the zoomfactor for the sub pages.
The opaquePages instance attribute optimizes some procedures when set to True (i.e. it prevents rendering sub pages that are hidden below others).
By default, only links in the first sub page are handled. Set linksOnlyFirstSubPage to False if you want links in all sub pages.
-
scalePages
= 1.0¶
-
opaquePages
= True¶
-
linksOnlyFirstSubPage
= True¶
-
renderer
= <qpageview.multipage.MultiPageRenderer object>¶
-
classmethod
createPages
(pageLists, renderer=None, pad=<class 'qpageview.page.BlankPage'>)[source]¶ Yield pages, taking each page from every pageList.
If pad is given and is not None, it is a callable that instantiates blank pages, to pad the shorter pageLists with. In that case, the returned list of pages has the same length as the longest pageList given. If pad is None, the returned list of pages has the same length as the shortest pageList given.
-
updateSize
(dpiX, dpiY, zoomFactor)[source]¶ Reimplemented to also position our sub-pages.
The default implementation of this method zooms the sub pages at the zoom level of the page * self.scalePages.
-
updatePagePositions
()[source]¶ Called by updateSize(), set the page positions.
The default implementation of this method centers the pages.
-
visiblePagesAt
(rect)[source]¶ Yield (page, rect) for all subpages.
The rect may be invalid when opaquePages is False. If opaquePages is True, pages outside rect or hidden below others are exclued. The yielded rect is always valid in that case.
-
printablePagesAt
(rect)[source]¶ Yield (page, matrix) for all subpages that are visible in rect.
If opaquePages is True, excludes pages outside rect or hidden below others. The matrix (QTransform) describes the transformation from the page to the sub page. Rect is in original coordinates, as with the print() method.
-
-
class
MultiPageDocument
(sources=(), renderer=None)[source]¶ Bases:
qpageview.document.MultiSourceDocument
A Document that combines pages from different documents.
-
pageClass
¶ alias of
qpageview.multipage.MultiPage
-
-
class
MultiPageRenderer
(cache=None)[source]¶ Bases:
qpageview.render.AbstractRenderer
A renderer that interfaces with the renderers of the sub pages of a MultiPage.
-
update
(page, device, rect, callback=None)[source]¶ Reimplemented to check/rerender (if needed) all sub pages.
-
paint
(page, painter, rect, callback=None)[source]¶ Reimplemented to paint all the sub pages on top of each other.
-