Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15, 6.2, 6.5, 6.6, 6.7, 6.8
-
None
Description
While not officially documented, QPrintPreviewWidget internally uses a relatively publicly available QGraphicsView.
This makes it possible to implement custom behavior on the preview widget (for instance, to add custom child items that improve performance of page previews, or other graphical elements that show page margins).
Unfortunately, this presents some indirect issues with existing behavior, specifically those that iterate through the graphics view items (see calcCurrentPage and _q_fit), since they always rely on the fact that only "PageItem" instances exist.
This can be easily fixed by ignoring items that are not PageItem instances in the above functions, should not affect performance that much, and could allow further extensibility of the print preview API.