summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpravindalve2023-02-15 11:27:26 +0530
committerpravindalve2023-02-15 11:27:26 +0530
commit84e5a6e56c1a639953bde3de5d8814d0f01a6be3 (patch)
tree24a28125ee57f33432af0e9a13e87306e95e8e38
parentac7143f433afb80fcebace61d759cf14514b6d28 (diff)
downloadChemical-PFD-84e5a6e56c1a639953bde3de5d8814d0f01a6be3.tar.gz
Chemical-PFD-84e5a6e56c1a639953bde3de5d8814d0f01a6be3.tar.bz2
Chemical-PFD-84e5a6e56c1a639953bde3de5d8814d0f01a6be3.zip
Fixed dropping issue for icons with ',' in the name
-rw-r--r--src/main/python/utils/graphics.py2
1 files changed, 1 insertions, 1 deletions
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)