Saving sim results
This commit is contained in:
@@ -1892,6 +1892,22 @@ class GraphWorkspaceView(QGraphicsView):
|
||||
if self.controller is None:
|
||||
return
|
||||
mime_data = QApplication.clipboard().mimeData()
|
||||
if mime_data.hasFormat(COMPONENT_MIME_TYPE):
|
||||
try:
|
||||
payload = json.loads(
|
||||
bytes(mime_data.data(COMPONENT_MIME_TYPE)).decode("utf-8")
|
||||
)
|
||||
source = Component.from_dict(payload)
|
||||
except (KeyError, TypeError, ValueError, json.JSONDecodeError):
|
||||
return
|
||||
component_id = self.controller.add_component_copy(source, QPointF(0, 0))
|
||||
scene = self.scene()
|
||||
if isinstance(scene, GraphScene):
|
||||
scene.clearSelection()
|
||||
item = scene.component_items.get(component_id)
|
||||
if item is not None:
|
||||
item.setSelected(True)
|
||||
return
|
||||
if not mime_data.hasFormat(SELECTION_MIME_TYPE):
|
||||
return
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user