spinetoolbox.widgets.custom_qgraphicsscene
¶
Custom QGraphicsScene used in the Design View.
author: |
|
---|---|
date: | 13.2.2019 |
Module Contents¶
-
class
spinetoolbox.widgets.custom_qgraphicsscene.
CustomQGraphicsScene
(parent, toolbox)[source]¶ Bases:
spinetoolbox.widgets.shrinking_scene.ShrinkingScene
A scene that handles drag and drop events of DraggableWidget sources.
Parameters: - parent (QObject) – scene’s parent object
- toolbox (ToolboxUI) – reference to the main window
-
resize_scene
(self)[source]¶ Resize scene to be at least the size of items bounding rectangle. Does not let the scene shrink.
-
set_bg_color
(self, color)[source]¶ Change background color when this is changed in Settings.
Parameters: color (QColor) – Background color
-
set_bg_grid
(self, bg)[source]¶ Enable or disable background grid.
Parameters: bg (boolean) – True to draw grid, False to fill background with a solid color
-
dragEnterEvent
(self, event)[source]¶ Accept event. Then call the super class method only if drag source is not a DraggableWidget (from Add Item toolbar).
-
dragMoveEvent
(self, event)[source]¶ Accept event. Then call the super class method only if drag source is not a DraggableWidget (from Add Item toolbar).