The imageview module

ImageView, a View optimized for display of one Page, e.g. one image.

Clicking in the view toggles between FitBoth and NaturalSize.

class ImageViewMixin(parent=None)[source]

Bases: object

View Mixin with a few customisations for displaying a single page/image.

Adds the instance variable:

fitNaturalSizeEnabled = True

If True, the image will not be scaled larger than its natural size when FitWidth, -Height, or -Both is active.

fitNaturalSizeEnabled = True

Convenience method to display a QImage.


Toggles between FitBoth and natural size.


Reimplemented to avoid zooming-to-fit larger than naturalsize.


Reimplemented to toggle between FitBoth and ZoomNaturalSize.

class ImageView(parent=None)[source]

Bases: qpageview.imageview.ImageViewMixin, qpageview.view.View

A View, optimized for display of one Page, e.g. one image.

Append one Page to the layout, use one of the load* methods to load a single page document, or use the setImage() method to display a QImage.

clickToSetCurrentPageEnabled = False

whether a mouse click in a page makes it the current page