Skip to content

Layer Video

app.ui.qt.widgets.preview.layer_video

View source code

Module for layer video; implements the Qt presentation components.

See Also

Layer: Presentation. Context: Implements the qt presentation components at this architectural boundary.

VideoDisplayWidget

Bases: QWidget

Provide the video display widget presentation component.

PARAMETER DESCRIPTION
parent

Optional Qt parent object.

TYPE: QWidget | None DEFAULT: None

pixmap_rect_changed = Signal(QRect, QSize) class-attribute instance-attribute

__init__(parent: QWidget | None = None) -> None

get_pixmap_rect() -> QRect

Return the image rectangle currently used for drawing.

RETURNS DESCRIPTION
QRect

Current image rectangle in widget coordinates.

paintEvent(event: QPaintEvent) -> None

Paint the current video frame or status message.

PARAMETER DESCRIPTION
event

Qt event being handled. (QPaintEvent).

TYPE: QPaintEvent

reset_viewport() -> None

Restore 1× zoom and zero pan, then recompute and redraw the image.

resizeEvent(event: QResizeEvent) -> None

Update the viewport after the widget is resized.

PARAMETER DESCRIPTION
event

Qt event being handled. (QResizeEvent).

TYPE: QResizeEvent

set_image(image: QImage) -> None

Display an image, recompute its fitted rectangle, and redraw.

PARAMETER DESCRIPTION
image

Image to display.

TYPE: QImage

set_message(message: str) -> None

Clear the image and display a centered placeholder message.

PARAMETER DESCRIPTION
message

Text to show when no image is available.

TYPE: str

set_pan(dx: float, dy: float) -> None

Set the display offset in widget coordinates and redraw.

PARAMETER DESCRIPTION
dx

Horizontal offset in pixels.

TYPE: float

dy

Vertical offset in pixels.

TYPE: float

set_zoom(factor: float) -> None

Set the display zoom, clamped to the range 1×–10×, and redraw.

PARAMETER DESCRIPTION
factor

Requested zoom multiplier.

TYPE: float