items.widgets.image_viewer#

A pop-up widget used to display an image preview of a selected item.

Classes:

ImageViewer([parent])

The top-level widget containing the QGraphicsScene items.

Viewer([parent])

The graphics view used to display a QPixmap.

Functions:

get_item_info(ref)

Gets a list of informative strings describing the image properties.

show(path, ref, parent[, oiio, max_size])

Shows the image preview widget.

class bookmarks.items.widgets.image_viewer.ImageViewer(parent=None)[source]#

Bases: QWidget

The top-level widget containing the QGraphicsScene items.

Methods:

keyPressEvent(event)

Key press event handler.

set_image(source, ref[, max_size, oiio])

Loads an image and displays the contents as a QPixmap item.

showEvent(event)

Event handler.

keyPressEvent(event)[source]#

Key press event handler.

set_image(source, ref, max_size=-1, oiio=False)[source]#

Loads an image and displays the contents as a QPixmap item.

Parameters:
  • source (str) – The path to the image.

  • ref (weakref.ref) – Pointer to an item data.

  • max_size (int, optional) – The maximum image size, or uses source size if -1.

  • oiio (bool, optional) – Use OpenImageIO to load the source image.

showEvent(event)[source]#

Event handler.

class bookmarks.items.widgets.image_viewer.Viewer(parent=None)[source]#

Bases: QGraphicsView

The graphics view used to display a QPixmap.

Methods:

keyPressEvent(event)

Key press event handler.

paintEvent(event)

Event handler.

wheelEvent(event)

Event handler.

keyPressEvent(event)[source]#

Key press event handler.

paintEvent(event)[source]#

Event handler.

wheelEvent(event)[source]#

Event handler.

bookmarks.items.widgets.image_viewer.get_item_info(ref)[source]#

Gets a list of informative strings describing the image properties.

Parameters:

ref (weakref.ref) – A reference to an item data.

Returns:

A list of image property strings.

bookmarks.items.widgets.image_viewer.show(path, ref, parent, oiio=False, max_size=-1)[source]#

Shows the image preview widget.

Parameters:
  • path (str) – The path to an image file.

  • ref (weakref.ref) – A reference to an item data.

  • parent (QWidget) – A parent widget.

  • oiio (bool) – When True, will use OpenImageIO to read the source image. Defaults to False.

  • max_size (int) – The maximum image size in pixels. If -1, use the source image size.

Returns:

The image preview widget instance.