summaryrefslogtreecommitdiff
path: root/src/main/python/utils/graphics.py
diff options
context:
space:
mode:
authorBlaine2020-05-27 05:13:47 +0530
committerBlaine2020-05-27 05:13:47 +0530
commitbbbda804aea58b006ed998bf54e581aa8c09e79b (patch)
tree589a55cfbde4bc1c693d90073aa149bc5ff846b4 /src/main/python/utils/graphics.py
parent39bc43643fdb9fd9e8aee8a68cb27b0aa7157486 (diff)
downloadChemical-PFD-bbbda804aea58b006ed998bf54e581aa8c09e79b.tar.gz
Chemical-PFD-bbbda804aea58b006ed998bf54e581aa8c09e79b.tar.bz2
Chemical-PFD-bbbda804aea58b006ed998bf54e581aa8c09e79b.zip
merge-commit 2
Diffstat (limited to 'src/main/python/utils/graphics.py')
-rw-r--r--src/main/python/utils/graphics.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py
index 1e701f9..783748b 100644
--- a/src/main/python/utils/graphics.py
+++ b/src/main/python/utils/graphics.py
@@ -45,9 +45,9 @@ class customView(QGraphicsView):
if QDropEvent.mimeData().hasText():
#QDropEvent.mimeData().text() defines intended drop item, the pos values define position
obj = QDropEvent.mimeData().text().split('/')
- graphic = getattr(shapes, obj[0])(*map(int, obj[1:]))
- graphic.setPen(QPen(Qt.black, 2))
- graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable)
+ graphic = getattr(shapes, obj[0])(*map(lambda x: int(x) if x.isdigit() else x, obj[1:]))
+ # graphic.setPen(QPen(Qt.black, 2))
+ # graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable)
self.scene().addItemPlus(graphic)
graphic.setPos(QDropEvent.pos().x()-150, QDropEvent.pos().y()-150)
QDropEvent.acceptProposedAction()