spinetoolbox.widgets.shrinking_scene

A QGraphicsScene that can shrink sometimes.

author:
  1. Soininen (VTT)
date:

18.10.2019

Module Contents

class spinetoolbox.widgets.shrinking_scene.ShrinkingScene(horizontal_shrinking_threshold, vertical_shrinking_threshold, parent)[source]

Bases: PySide2.QtWidgets.QGraphicsScene

A QGraphicsScene class that can shrinks its scene rectangle.

Shrinking can be triggered by shrink_if_needed(). It is controlled by two threshold values which control how far the items need to be from the scene rectangle’s edges to trigger the shrinking.

Parameters:
  • horizontal_shrinking_threshold (float) – horizontal threshold before the scene is shrank
  • vertical_shrinking_threshold (float) – vertical threshold before the scene is shrank
  • parent (QObject) – a parent
item_move_finished[source]

Emitted when an item has finished moving.

shrink_if_needed(self)[source]

Shrinks the scene rectangle if it is considerably larger than the area occupied by items.