Skip to content

Bbox State

app.ui.qt.widgets.preview.layer_bbox.bbox_state

View source code

Module for bbox state; implements the Qt presentation components.

See Also
  • DragMode — identifies the active drag interaction
  • interaction — updates this state during pointer gestures

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

BBoxState dataclass

Represent bbox state.

ATTRIBUTE DESCRIPTION
rect

Stored rect value.

TYPE: QRect

drag_mode

Stored drag mode value.

TYPE: DragMode

drag_origin

Stored drag origin value.

TYPE: QPoint

rect_at_drag_start

Stored rect at drag start value.

TYPE: QRect

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

drag_mode: DragMode = DragMode.NONE class-attribute instance-attribute

drag_origin: QPoint = field(default_factory=QPoint) class-attribute instance-attribute

has_valid_rect: bool property

Return whether the rectangle has positive width and height.

RETURNS DESCRIPTION
bool

True when the rectangle is non-null and has positive dimensions.

rect: QRect = field(default_factory=QRect) class-attribute instance-attribute

rect_at_drag_start: QRect = field(default_factory=QRect) class-attribute instance-attribute

__init__(rect: QRect = QRect(), drag_mode: DragMode = DragMode.NONE, drag_origin: QPoint = QPoint(), rect_at_drag_start: QRect = QRect()) -> None