From 84e5a6e56c1a639953bde3de5d8814d0f01a6be3 Mon Sep 17 00:00:00 2001 From: pravindalve Date: Wed, 15 Feb 2023 11:27:26 +0530 Subject: Fixed dropping issue for icons with ',' in the name --- src/main/python/utils/graphics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index 615843f..5a44400 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -40,7 +40,7 @@ class CustomView(QGraphicsView): #defines item drop, fetches text, creates corresponding QGraphicItem and adds it to scene if QDropEvent.mimeData().hasText(): #QDropEvent.mimeData().text() defines intended drop item, the pos values define position - obj = QDropEvent.mimeData().text().split('/') + obj = QDropEvent.mimeData().text().replace(',', '').split('/') graphic = getattr(shapes, obj[0])(*map(lambda x: int(x) if x.isdigit() else x, obj[1:])) graphic.setPos(QDropEvent.pos().x(), QDropEvent.pos().y()) self.scene().addItemPlus(graphic) -- cgit