Skip to content

Ui Handler

app.ui.handlers.ui_handler

View source code

Frame rendering and UI view_state management handler.

See Also

Layer: Presentation. Context: Converts user actions and worker signals into application calls and UI feedback.

UIHandler

Manages frame rendering and UI view_state updates.

Responsibilities
  • Fetch and render video frames from session cache.
  • Draw bounding boxes (detections and tracking) on frames.
  • Update frame label (current frame / total frames).
  • Update seek slider range and position.
  • Populate detection and tracking data tabs.
  • Convert RGB frames to QImage for display.
Note

Separates rendering logic from handler coordination. Does not emit signals (utility class for UI updates). Works with RGBFrame data from session cache. Converts frames and generates overlays for preview container.

Layer: Presentation. Context: Supports user interaction and delegates application work through presentation contracts.

__init__(controller: UIController) -> None

controller: The UIController instance that coordinates the UI handlers.

render_saved_frame(s_id: SessionId) -> None

Fetch, draw boxes on, and display the current frame for a session.

Note

Triggered by UIController.render_frame_for_session_id() internal calls.

Flow: render_saved_frame(s_id) [this slot] ├── Get session and current frame from cache ├── Draw detection and tracking boxes on frame └──> Update UI labels, seek slider, and status bar

Handles: Frame acquisition from session cache. Bounding detection drawing (detection + tracking overlays). UI view_state sync (frame label, seek position, status text).

set_boxes_for_tab(boxes: ListOfBoxes, tab: VideoDataLayerGroup) -> None

Update the data boxes displayed in a specific tab.

PARAMETER DESCRIPTION
boxes

List of BBoxViewModel objects to display.

TYPE: ListOfBoxes

tab

Target tab (DataBox.DETECTION or DataBox.TRACKING).

TYPE: VideoDataLayerGroup

update_status_bar() -> None

Update status bar with session metadata and playback view_state.

Note

Flow: update_status_bar() ├── Fetch active session ├── Extract metadata (filename, resolution, FPS, frame count) ├── Extract playback view_state (current frame, playing status) └──> Format and set status text

Status Format: filename | 1920x1080 | 30.00 fps | 1/1500 frames | Playing | Model: yolov8n.