summaryrefslogtreecommitdiff
path: root/src/main/python/utils/graphics.py
diff options
context:
space:
mode:
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()