editor.base_widgets#

A list of widgets and methods used by bookmarks.editor.base.BasePropertyEditor.

Classes:

BaseComboBox([parent])

Base combobox used by BasePropertyEditor.

SGAssetTypesWidget([parent])

ShotGrid entity type picker.

SGProjectTypesWidget([parent])

ShotGrid entity type picker.

ThumbnailContextMenu(index[, parent])

Context menu associated with the ThumbnailEditorWidget.

ThumbnailEditorWidget([size, ...])

Widget used to edit item thumbnails.

Functions:

process_image(source)

Converts, resizes and loads an image file as a QImage.

class bookmarks.editor.base_widgets.BaseComboBox(parent=None)[source]#

Bases: QComboBox

Base combobox used by BasePropertyEditor.

Methods:

addItem(*args, **kwargs)

Custom add item function.

decorate_item([error])

Changes the appearance of the item.

init_items()

Initializes the items.

addItem(*args, **kwargs)[source]#

Custom add item function.

decorate_item(error=False)[source]#

Changes the appearance of the item.

init_items()[source]#

Initializes the items.

class bookmarks.editor.base_widgets.SGAssetTypesWidget(parent=None)[source]#

Bases: BaseComboBox

ShotGrid entity type picker.

Methods:

init_items()

Initialize items.

init_items()[source]#

Initialize items.

class bookmarks.editor.base_widgets.SGProjectTypesWidget(parent=None)[source]#

Bases: BaseComboBox

ShotGrid entity type picker.

Methods:

init_items()

Initialize items.

init_items()[source]#

Initialize items.

class bookmarks.editor.base_widgets.ThumbnailContextMenu(index, parent=None)[source]#

Bases: BaseContextMenu

Context menu associated with the ThumbnailEditorWidget.

Methods:

setup()

Creates the context menu.

setup()[source]#

Creates the context menu.

class bookmarks.editor.base_widgets.ThumbnailEditorWidget(size=THUMBNAIL_EDITOR_SIZE, fallback_thumb='placeholder', parent=None)[source]#

Bases: ClickableIconButton

Widget used to edit item thumbnails.

Methods:

capture()

Captures a thumbnail and save it as a QImage.

contextMenuEvent(event)

Context menu event handler.

dragEnterEvent(event)

Drag event handler.

dragLeaveEvent(event)

Drag leave event handler.

dragMoveEvent(event)

Drag move event handler.

dropEvent(event)

Drop event handler.

enterEvent(event)

Enter event handler.

hide_window()

Move the window out of view.

image()

The current thumbnail image.

leaveEvent(event)

Leave event handler.

paintEvent(event)

Paint event handler.

pick_image()

Pick image action.

process_image(source)

Load and set an image from a source file.

reset_image()

Clears the selected thumbnail image.

save_image([destination])

Saves the selected thumbnail image to the file.

set_image(image)

Sets the given QImage as the current image.

capture()[source]#

Captures a thumbnail and save it as a QImage.

The captured image is stored internally in self._image and saved to disk when self.save_image() is called.

contextMenuEvent(event)[source]#

Context menu event handler.

dragEnterEvent(event)[source]#

Drag event handler.

dragLeaveEvent(event)[source]#

Drag leave event handler.

dragMoveEvent(event)[source]#

Drag move event handler.

dropEvent(event)[source]#

Drop event handler.

enterEvent(event)[source]#

Enter event handler.

hide_window()[source]#

Move the window out of view.

image()[source]#

The current thumbnail image.

leaveEvent(event)[source]#

Leave event handler.

paintEvent(event)[source]#

Paint event handler.

pick_image()[source]#

Pick image action.

process_image(source)[source]#

Load and set an image from a source file.

Parameters

source (str) – The path to the image file.

reset_image()[source]#

Clears the selected thumbnail image.

save_image(destination=None)[source]#

Saves the selected thumbnail image to the file.

set_image(image)[source]#

Sets the given QImage as the current image.

Parameters

image (QImage) – The image to set.

bookmarks.editor.base_widgets.process_image(source)[source]#

Converts, resizes and loads an image file as a QImage.

Parameters

source (str) – Path to an image file.

Returns

The resized QImage, or None if the image was not processed successfully.

Return type

QImage